Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. 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
    titleUsing 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
    titleThe 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.

  2. 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.
    Code Block
     $ ant compile-cpp -Dthrift.home=<THRIFT_HOME>
     
    MVN:
    Code Block
    
    $ cd odbc
    $ mvn compile -Podbc -Dthrift.home=/usr/local -Dboost.home=/usr/local
     

You can optionally force Hive client to compile into a non-native bit architecture by specifying the additional parameter (assuming you have the proper compilation libraries):

Code Block

 $ ant compile-cpp -Dthrift.home=<THRIFT_HOME> -Dword.size=<32 or 64>
 
  1. 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.
    Code Block
     $ ant test -Dthrift.home=<THRIFT_HOME>
     
    MVN:
    Code Block
    
    $ cd odbc
    $ mvn test -Podbc -Dthrift.home=/usr/local -Dboost.home=/usr/local
     
    You can specifically execute the Hive client tests by running the above command from HIVE_SRC_ROOT/odbc/. NOTE: Hive client tests require that a local Hive Server be operating on port 10000.
  2. 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 of HIVE_SRC_ROOT/build/odbc/lib and HIVE_SRC_ROOT/build/odbc/include into their local file system counterparts.
    Code Block
     $ sudo ant install -Dthrift.home=<THRIFT_HOME>
     
    NOTE: The compiled static library, libhiveclient.a, requires linking with stdc++ as well as thrift libraries to function properly.
    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.

...