https://github.com/tailhook/aio-hs2
Hiveserver2 (sharkserver2) client for asyncio (abandoned due to death of shark project)
https://github.com/tailhook/aio-hs2
Last synced: about 1 year ago
JSON representation
Hiveserver2 (sharkserver2) client for asyncio (abandoned due to death of shark project)
- Host: GitHub
- URL: https://github.com/tailhook/aio-hs2
- Owner: tailhook
- License: other
- Created: 2014-05-15T10:50:43.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-05-23T08:59:36.000Z (about 12 years ago)
- Last Synced: 2025-03-27T15:47:42.813Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 223 KB
- Stars: 1
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
===============================
Asyncio-base Hiveserver2 Client
===============================
This client can connect both hiveserver2 from hive and sharkserver2 for shark
(because latter have same protocol and semantics)
Package contains:
* ``thrift/`` -- a copy of thrift python library adapted for python3.
The code originally in https://github.com/tailhook/thrift/tree/asyncio
* ``aiohs2/lowlevel`` -- python files generated for ``TCLIService.thrift`` from
hive. To regenerate bindings run ``./genbindings.sh`` (you need to build
thrift from aformentioned branch and you need hive sources, script will not
do that for you)
To use a library you just install it with ``pip`` or ``setup.py``.
Basic Usage
-----------
.. code-block:: python
cli = Client('localhost', 10000)
with (yield from cli.cursor()) as cur:
yield from cur.execute("SELECT * FROM table LIMIT 10")
rows = yield from cur.fetch()
print("ROWS", rows)
Upgrade Notes
-------------
In version 0.1 client was connected by ``Client.connect`` and cursor was
created by a plain function (not coroutine). It's changed to support
transparent reconnection.