Python API for unittest Hive applications
Project description
py-hiverunner
Library provides python API for Klarna's HiveRunner.
Install
Install py-hiverunner
package with pip:
$ python -m pip install py-hiverunner
Usage
Before using py-hiverunner
you need start JVM with facade service based on original Klarna's HiveRunner
-
java-hiverunner.
This repo provides docker container for Py4J Java Gateway for HiveRunner.
You can pull this:
$ docker pull la9ran9e/py-hiverunner
and then run the container:
$ docker run -ti -p 25333:25333 -p 25334:25334 la9ran9e/py-hiverunner
After that you will have working server with Java HiveRunner.
Try this:
from py_hiverunner import create_hiverunner
from pprint import pprint
with create_hiverunner() as hive:
hive.execute_query("create schema meh")
hive.execute_query("create table meh.nonsub(a int, b string, c array<string>)")
hive.execute_query("insert into meh.nonsub select 1, 'la9ran9e', array('1', 'a', 'b', '6')")
hive.execute_query("insert into meh.nonsub select 2, 'la9ran9e', array('1', 'b', 'b', '6')")
hive.execute_query("insert into meh.nonsub select 3, 'la9ran9e', array('1', 'c', 'b', '6')")
hive.execute_query("insert into meh.nonsub select 4, '', array('1', 'd', 'b', '6')")
print("RESULT:")
pprint(hive.execute_query("select * from meh.nonsub where b = 'la9ran9e'"))
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
py-hiverunner-0.1.1.tar.gz
(5.2 kB
view hashes)
Built Distribution
Close
Hashes for py_hiverunner-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcbf726a3b3c45efbc05cb18051ae5210829ca8f408a9587c740c3baba69e22c |
|
MD5 | 2b83f720ca53b0c946735c57895c4d5b |
|
BLAKE2b-256 | e0ffdb7a6577dada21a20ae69cf2da196e10ad0b051711babd1466826b293aba |