Skip to main content

A package interact with the Hive metastore (API version 3.0) via the Thrift protocol

Project description

This repo is just a rebuild of @gglanzani great work here: https://github.com/gglanzani/hmsclient. All I have done is to regenerate the code according to the authors instructions (below). After installing all the prereqs, the command ran to regenerate the code was:

python generate.py --metastore_url https://raw.githubusercontent.com/apache/hive/branch-3.0/standalone-metastore/src/main/thrift/hive_metastore.thrift

Below: the original writers notes

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-hive-3 or directly from source

python setup.py install

Usage

Using it from Python is simple:

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)

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hmsclient-hive-3-0.1.1.tar.gz (112.8 kB view details)

Uploaded Source

File details

Details for the file hmsclient-hive-3-0.1.1.tar.gz.

File metadata

  • Download URL: hmsclient-hive-3-0.1.1.tar.gz
  • Upload date:
  • Size: 112.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.20.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.5

File hashes

Hashes for hmsclient-hive-3-0.1.1.tar.gz
Algorithm Hash digest
SHA256 45b40f6d504e1c341184b04283f4bd93374ceb8f5ac945a92fc1899162aa26c9
MD5 c1137bdabe75931be3f8621aebdbe8b1
BLAKE2b-256 0a873a0638e25037030fb85e45a7bf3fd7f2cea6437ad72c3304e252dcab254a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page