Hive编程(十二)【开发】

来源:互联网 发布:java句柄是什么意思 编辑:程序博客网 时间:2024/06/05 23:43

12.1 修改Log4J属性

Hive使用$HIVE_HOME/conf目录下的2个Log4j配置文件来配置日志。hive-log4j.properties文件控制CLI和其他本地执行组件的日子。hive-exec-log4j.properties控制MapReduce tasks内的日志。

使用hiveconf修改Hive日志级别

$ bin/hive -hiveconf hive.root.logger=DEBUG,console 
12/03/27 08:46:01 WARN conf.HiveConf: hive-site.xml not found on CLASSPATH
12/03/27 08:46:01 DEBUG conf.Configuration: java.io.IOException: config()

12.2 连接Java调试器到Hive


$ bin/hive --help --debug 
Allows to debug Hive by connecting to it via JDI API
Usage: hive --debug[:comma-separated parameters list]
Parameters:
recursive=<y|n> Should child JVMs also be started in debug mode. Default: y
port=<port_number> Port on which main JVM listens for debug connection. Defaul...
mainSuspend=<y|n> Should main JVM wait with execution for the debugger to con...
childSuspend=<y|n> Should child JVMs wait with execution for the debugger to c...
swapSuspend Swaps suspend options between main and child JVMs

12.3 从源码编译Hive

12.3.1 执行Hive测试用例

12.3.2 执行hook

12.4 配置Hive和Eclipse

12.5 Maven工程中使用Hive

<dependency> 
<groupId>org.apache.hive</groupId>
<artifactId>hive-service</artifactId>
<version>0.9.0</version>
</dependency>

12.6 Hive中使用hive_test进行单元测试

12.7 新增的插件开发工具箱(PDK)