Chapter 12. Developing

Hive won’t provide everything you could possibly need. Sometimes a third-party library will fill a gap. At other times, you or someone else who is a Java developer will need to write user-defined functions (UDFs; see Chapter 13), SerDes (see Record Formats: SerDes), input and/or output formats (see Chapter 15), or other enhancements.

This chapter explores working with the Hive source code itself, including the new Plugin Developer Kit introduced in Hive v0.8.0.

Changing Log4J Properties

Hive can be configured with two separate Log4J configuration files found in $HIVE_HOME/conf. The file controls the logging of the CLI or other locally launched components. The file controls the logging inside the MapReduce tasks. These files do not need to be present inside the Hive installation because the default properties come built inside the Hive JARs. In fact, the actual files in the conf directory have the .template extension, so they are ignored by default. To use either of them, copy it with a name that removes the .template extension and edit it to taste:

$ cp conf/ conf/
$ ... edit file ...

It is also possible to change the logging configuration of Hive temporarily without copying and editing the Log4J files. The hiveconf switch can be specified on start-up with definitions of any properties in the file. For example, here we set the default logger to the ...

Get Programming Hive now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.