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 hive-log4j.properties file controls the logging of the CLI or other locally launched components. The hive-exec-log4j.properties 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/hive-log4j.properties.template conf/hive-log4j.properties
$ ... 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 log4.properties file. For example, here we set the default logger to the ...

Get Programming Hive now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.