About Thrift

This project uses the Thrift mapping files and the Thrift package to auto generate the python libraries that you can find in thrift_files/libraries/.

Updating the Thrift Hive Metastore client

Requirements

The thrift service mapping

Download the hive_metastore.thrift (and its required thrift files if any. Then place them in the same directory).

These two files are the mapping for the Thrift Service that the Hive Metastore is built on:

We are using the Hive Metastore version 3.0 (branch-3.0)

Thrift package

1 - First you need to install the thrift package so you can “compile” the thrift file into python code. You can refer to these tutorial for installing it: https://thrift-tutorial.readthedocs.io/en/latest/installation.html. We used the latest version (0.14.0) of the Thrift package.

2 - After installing thrift package, you should open the directory where the hive_metastore.thrift (and others) is placed and run:

thrift --gen py hive_metastore.thrift
thrift --gen py fb303.thrift

3 - Now you have the new python code generated inside gen-py. Extract the classes and place them in the right directories - we use thrift_files/libraries/ for these generate libraries.

4 - The generated files are huge, therefore be sure that the generated files directory names are ignored in the make commands style-check and apply-lint. So these files are not evaluated during the checks.