基础环境: Apache Hadoop2.7.1 Centos6.5 Apache Hadoop2.7.1 Apache Hbase0.98.12 Apache Hive1.2.1 Apache Tez0.7.0 Apache Pig0.15.0 Apache oozie4.2.0 Apache Spark1.6.0 Cloudrea Hue3.8.1 经测试,spark1.6.0和spark1.5.x集成hive on spark有问题, 相关链接:http://apache-spark-user-list.1001560.n3.nabble.com/Issue-with-spark-on-hive-td25372.html 所以只能下载spark-1.4.1然后执行如下命令,重新编译: dev/change-scala-version.sh 2.11 mvn -Pyarn -Phadoop-2.7.1 -Dscala-2.11 -DskipTests clean package 编译完成后,拷贝ssembly/target/scala-2.11/spark-assembly-1.4.1-hadoop2.7.1.jar 到hive的lib目录下 即可, 然后启动hive: set hive.execution.engine=spark; 执行一个查询:
可以执行没有问题,但在测试hive关联hbase表使用spark模式运行的时候,会出现一个异常,spark的kvro序列化总是找不到hbase的一个类,但明明已经启动的时候,加入到hive的class path里面了,经查资料,貌似是hive的一个bug, 但hive on tez模式是可以正常读取hbase表里面的数据的,后续在测试下,看看是否正常。