...
- Checkout and setup the latest version of Apache Hive from the Subversion or Git source code repository. For more details, see Getting Started with Hive. From this point onwards, the path to the Hive root directory will be referred to as HIVE_SRC_ROOT.
Note title Using a tarball source release If you are compiling against source code contained in the tarball release package then HIVE_SRC_ROOT refers to the 'src' subdirectory.
Warning title The ODBC driver is broken on trunk! Currently the C++ Thrift client library that the ODBC driver depends on will not build on trunk. This issue is being tracked in HIVE-4433. If you are using trunk prior to release 0.12 check the status of this ticket before proceeding. Also see HIVE-4492.
- Build the Hive client by running the following command from HIVE_SRC_ROOT. This will compile and copy the libraries and header files to
HIVE_SRC_ROOT/build/odbc/
. Please keep in mind that all paths should be fully specified (no relative paths). If you encounter an "undefined reference to vtables
" error, make sure that you have specified the absolute path for thrift.home.
MVN:Code Block $ ant compile-cpp -Dthrift.home=<THRIFT_HOME>
Code Block $ cd odbc $ mvn compile -Podbc,hadoop-1 -Dthrift.home=/usr/local -Dboost.home=/usr/local
...
- You can verify the entire Hive compilation by running the Hive test suite from HIVE_SRC_ROOT. Specifying the argument '-Dthrift.home=<THRIFT_HOME>' will enable the tests for the Hive client. If you do NOT specify thrift.home, the Hive client tests will not be run and will just return successful.
MVN:Code Block $ ant test -Dthrift.home=<THRIFT_HOME>
You can specifically execute the Hive client tests by running the above command fromCode Block $ cd odbc $ mvn test -Podbc,hadoop-1 -Dthrift.home=/usr/local -Dboost.home=/usr/local
HIVE_SRC_ROOT/odbc/
. NOTE: Hive client tests require that a local Hive Server be operating on port 10000. - To install the Hive client libraries onto your machine, run the following command from
HIVE_SRC_ROOT/odbc/
. NOTE: The install path defaults to/usr/local
. While there is no current way to change this default directory from the ant build process, a manual install may be performed by skipping the command below and copying out the contents ofHIVE_SRC_ROOT/build/odbc/lib
andHIVE_SRC_ROOT/build/odbc/include
into their local file system counterparts.
NOTE: The compiled static library, libhiveclient.a, requires linking with stdc++ as well as thrift libraries to function properly.Code Block $ sudo ant install -Dthrift.home=<THRIFT_HOME>
NOTE: Currently, there is no way to specify non-system library and header directories to the unixODBC build process. Thus, the Hive client libraries and headers MUST be installed to a default system location in order for the unixODBC build process to detect these files. This issue may be remedied in the future.
...