Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support HeavyDB #447

Merged
merged 6 commits into from
Mar 4, 2022
Merged

Support HeavyDB #447

merged 6 commits into from
Mar 4, 2022

Conversation

pearu
Copy link
Contributor

@pearu pearu commented Mar 2, 2022

To test rbc against HeavyDB (former OmnisciDB) server, define HEAVYAI_BRAND environment variable.
When HEAVYAI_BRAND is not defined or contains a value omnisci then rbc expects that OmniscDB 5.10.2 or older server is running.

rbc detects HeavyDB brand using the server version information.

@pearu pearu self-assigned this Mar 2, 2022
@pearu pearu added the enhancement New feature or request label Mar 2, 2022
@github-actions
Copy link

github-actions bot commented Mar 2, 2022

Hi @pearu! Add at least one of the required labels to this PR

Required labels are : deprecation, enhancement, bug, documentation, tests, notebook

@guilhermeleobas
Copy link
Contributor

export HEAVYAI_BRAND=heavyai

Could we automatically switch to heavyai when the server version is greater than 5.10.*?

@pearu
Copy link
Contributor Author

pearu commented Mar 2, 2022

Could we automatically switch to heavyai when the server version is greater than 5.10.*?

I guess we can. Since omniscidb and heavydb use different dbname's, it will require trying out different configurations when connecting to the server. I'll give it a try...

@pearu pearu requested a review from guilhermeleobas March 3, 2022 11:52
Copy link
Contributor

@guilhermeleobas guilhermeleobas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work, pearu. I wonder if it makes sense to rename the rbc/tests/*_omnisci_* test files and specific functions:

  • rbc.externals.omniscidb -> rbc.externals.heavydb
  • rbc.omnisci_backend -> rbc.heavy_backend

rbc/omniscidb.py Show resolved Hide resolved
rbc/omniscidb.py Outdated
Comment on lines 339 to 360
def get_heavydb_version(host='localhost', port=6274, _cache={}):
"""Acquires the version of heavydb server.
"""
if (host, port) in _cache:
return _cache[host, port]
thrift_content = '''
exception TMapDException {
1: string error_msg
}
service Omnisci {
string get_version() throws (1: TMapDException e)
}
'''
client = ThriftClient(
host=host,
port=port,
multiplexed=False,
thrift_content=thrift_content,
socket_timeout=60000)
version = client(Omnisci=dict(get_version=()))['Omnisci']['get_version']
_cache[host, port] = version = parse_version(version)
return version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is needed because at this point one cannot use heavyai.get_version(), right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. In fact, at the point when executing heavyai.get_version(), we know what is the brand of heavydb but here we only know what is host:port of the heavydb server.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition, if dbname would be the same for different heavydb brands, we would not need this function.

@pearu pearu mentioned this pull request Mar 3, 2022
@pearu
Copy link
Contributor Author

pearu commented Mar 3, 2022

I wonder if it makes sense to rename the rbc/tests/*_omnisci_* test files and specific functions:

Yes, see #451

@pearu pearu merged commit f6021b7 into master Mar 4, 2022
@pearu pearu deleted the pearu/heavyai-brand branch March 4, 2022 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants