...
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.
- Install boost which is used to compile thrift in Mac OS
- You can get the boost sources here: http://sourceforge.net/projects/boost/files/
- Download the bzip2 of boost and unpack it
- Go to the unpacked directory
./bootstrap.sh
./bjam
./bjam install
- Install thrift
- Get approved thrift version,
thrift-0.7.0
, from http://incubator.apache.org/thrift/download/. - Unpack the tgz file and change to the parent of thrift directory
chmod -R 777 thrift-0.7.0
cd thrift-0.7.0
./configure
make
make install
- Download http://svn.apache.org/repos/asf/thrift/branches/0.7.x/contrib/fb303/if/fb303.thrift to
/usr/local/share/fb303/if
cd <hive-trunk>/metastore/
ant thriftif -Dthrift.home=/usr/local
- Get approved thrift version,
Notes:
- Some of the commands may need "sudo" mode. Please use it accordingly.
- 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:
...