Versions Compared

Key

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

...

If you are changing hive_service.thrift, the steps should be similar. In both cases, you may also need to deal with recompiling C++ clients as well.

Generate thrift code in Mac OS

You can follow the instructions to generate thrift code in Mac OS. For example, you change metastore/if/hive_metastore.thrift and want to regenerate code.

  1. Install boost which is used to compile thrift in Mac OS
    1. You can get the boost sources here: http://sourceforge.net/projects/boost/files/
    2. Download the bzip2 of boost and unpack it
    3. Go to the unpacked directory
    4. ./bootstrap.sh
    5. ./bjam
    6. ./bjam install
  2. Install thrift
    1. Get approved thrift version, thrift-0.7.0, from http://incubator.apache.org/thrift/download/.
    2. Unpack the tgz file and change to the parent of thrift directory
    3. chmod -R 777 thrift-0.7.0
    4. cd thrift-0.7.0
    5. ./configure
    6. make
    7. make install
    8. Download http://svn.apache.org/repos/asf/thrift/branches/0.7.x/contrib/fb303/if/fb303.thrift to /usr/local/share/fb303/if
    9. cd <hive-trunk>/metastore/
    10. ant thriftif -Dthrift.home=/usr/local

Notes:

  1. Some of the commands may need "sudo" mode. Please use it accordingly.
  2. It assumes thrift is installed in /usr/local/bin/thrift. Otherwise, please change it accordingly.

Metastore JDO Changes

For some changes, you may need to update the persistence specification in hive/metastore/src/model/package.jdo, together with the various Java data access classes which it references. If you get this wrong (e.g. adding a new field in JDO without adding corresponding getters and setters in the Java class), you'll get an error like this at runtime:

...