A package interact with Hive Server 2 via the Thrift protocol
Project description
This project aims to be an up to date Python client to interact with Hive Server 2 using the Thrift protocol.
Installation
Install it with pip install hs2client or directly from source
python setup.py install
Usage
Using it from Python is simple:
from hs2client.hs2client import HS2Client
client = HS2Client(host='127.0.0.1', username='user', port=10000, auth='NONE')
with client as connection, connection.cursor() as cursor:
cursor.arraysize = 10
cursor.execute('select * from table')
for row in cursor:
print(row)
Regenerate the Python thrift library
The hs2client.py is just a thin wrapper around the generated Python code to interact with Hive Server 2 through the Thrift protocol.
To regenerate the code using a newer version of the .thrift files, you can use generate.py (note: you need to have thrift installed, see here)
python generate.py --help
Usage: generate.py [OPTIONS]
Options:
--hive_server2_url TEXT The URL where the TCLIService.thrift file can be downloaded
--package TEXT The package where the client should be placed
--subpackage TEXT The subpackage where the client should be placed
--help Show this message and exit.
Otherwise the defaults will be used.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hs2client-0.1.0.tar.gz
(29.7 kB
view hashes)
Built Distributions
hs2client-0.1.0-py3.6.egg
(84.0 kB
view hashes)
hs2client-0.1.0-py3-none-any.whl
(32.0 kB
view hashes)
hs2client-0.1.0-py2.7.egg
(80.0 kB
view hashes)
Close
Hashes for hs2client-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b19f16c60c498ca2b863063036bff735c1b01794cb28e5974c5c92cd467c0275 |
|
MD5 | 209a70422d3ce5cff57b1af9f5a38776 |
|
BLAKE2b-256 | 67f06c5c285bcc5602a4e77a320cb8f8b5ac6304ec093e66b314111f739c4990 |