GitXplorerGitXplorer
g

hmsclient

public
20 stars
11 forks
5 issues

Commits

List of commits on branch master.
Unverified
c40e15abbffc82d287fb499d08111392643f3f10

Fix add_partition bug

ggglanzani committed 7 years ago
Unverified
c38d649a4652be39f6d4d434a239a4e419cdf30e

Update README

ggglanzani committed 7 years ago
Unverified
7fbe599a95c37849445f99f1632af4b07001a340

Bump version

ggglanzani committed 7 years ago
Unverified
93335b23d9be3074c4c00e752ced996028de204d

Pin hive version

ggglanzani committed 7 years ago
Unverified
75c452f3111af5d09680bf53fa32fe407e6d2ec5

Update README

ggglanzani committed 7 years ago
Unverified
5d51c5164f4a1f924e0a18bec19d3622d161d79d

Update project with click

ggglanzani committed 7 years ago

README

The README file for this repository.

HMSClient

This project aims to be an up to date Python client to interact with the Hive metastore using the Thrift protocol.

Installation

Install it with pip install hmsclient or directly from source

.. code-block:: python

python setup.py install

Usage

Using it from Python is simple:

.. code-block:: python

from hmsclient import hmsclient
client = hmsclient.HMSClient(host='localhost', port=9083)
with client as c:
    c.check_for_named_partition('db', 'table', 'date=20180101')

Regenerate the Python thrift library

The hmsclient.py is just a thin wrapper around the generated Python code to interact with the metastore 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_)

.. code-block:: sh

python generate.py --help

Usage: generate.py [OPTIONS]

Options:
  --fb303_url TEXT      The URL where the fb303.thrift file can be downloaded
  --metastore_url TEXT  The URL where the hive_metastore.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.

.. _here: https://thrift-tutorial.readthedocs.io/en/latest/installation.html