Hive 编译并提交Patch

来源:互联网 发布:微信网络出错1200 编辑:程序博客网 时间:2024/04/29 17:28

Hive编译安装

  • Hive 源码编译
    mvn clean install -Phadoop-2,dist -DskipTests -Dhadoop-23.version=2.6.5 -Dspark.version=2.0.0

  • 编译itests模块
    mvn clean install -DskipTests -Phadoop-2 -Dhadoop-23.version=2.6.5

  • 单独编译ql模块
    mvn clean install -DskipTests -Phadoop-2 -Dhadoop-23.version=2.6.5

  • 对测试语句unit test
    mvn test -Phadoop-2 -Dmodule=ql -Dtest=TestCliDriver -Dqfile=with_column_pruner.q -Dhadoop-23.version=2.6.5
    第一次可以添加 -Dtest.output.overwrite=true 参数

  • Unit test 执行结果
    ${HIVE_SRC}/itests/qtest/target/qfile-results/clientpositive/ptf_matchpath.q.out

  • Unit test 结果对比的目标文件:
    ${HIVE_SRC}/ql/src/test/results/clientpositive/ptf_matchpath.q.out

  • 测试通过后,生成Patch文件
    git diff --cached > HIVE-15944.4-branch-1.1.1.path

  • 在进行单独模块编译或者运行测试的时候,对于snapshot版本会对比本地仓库和远程仓库中jar包的编译时间,如果远程仓库有更新的编译时间版本,会进行远程下载,所以出现远程下载Jar包的时候,可以先把本地代码进行编译安装。

  • Hive本地安装多个版本的时候,Metastore可能需要单独分别进行初始化。初始化命令:schematool -dbType mysql -initSchema
create database hive3;GRANT all ON hive3.* TO root@'%' IDENTIFIED BY 'password';
  • Hive 开启调试模式:hive -hiveconf hive.root.logger=DEBUG,console ,在本地启动8000监听端口。随后即可以在Idea中开启远程调试模式。

  • Spark 编译
    ./make-distribution.sh --tgz -Pscala-2.11 -Phadoop-2.6 -Dhadoop.version=2.6.5 .
    --with-tachyon -Pyarn -Phive 这些作为可选Profile,在运行Hive的编译和测试的时候,不能有 -Phive 选项 .

0 0
原创粉丝点击