我正在使用sparkauncher启动一个spark应用程序。在spark应用程序中,我将数据插入配置单元表,并在join查询中使用一些hbase配置单元链接表。我在spark launcher中添加了hive-hbase-handler-1.1.0-cdh5.13.0.jar,仍然是因为:java.lang.classnotfoundexception:org.apache.hadoop.hive.hbase.hivehbasetableinputformat我在sparklauncher中添加了jar错误:
def launch(hdfsFilePath:String):Unit={
println("Inside ApplicationLauncher")
val command = new SparkLauncher()
.setAppResource("/home/cloudera/Desktop/Avi/LiveProjects/MusicDataAnalysis/target/scala-2.11/musicdataanalysis_2.11-0.1.jar")
.setMainClass("ParseInputFile")
.setVerbose(false)
.addAppArgs(hdfsFilePath)
.setMaster("local")
.addJar("/home/cloudera/Desktop/Avi/jars/hive-hbase-handler-1.1.0-cdh5.13.0.jar")
.addJar("/home/cloudera/Desktop/Avi/jars/spark-xml_2.11-0.5.0.jar")
println("Done with Spark Launcher")
val appHandle = command.startApplication()
appHandle.addListener(new SparkAppHandle.Listener{
def infoChanged(sparkAppHandle : SparkAppHandle) : Unit = {
// println(sparkAppHandle.getState + " Custom Print")
}
def stateChanged(sparkAppHandle : SparkAppHandle) : Unit = {
println(sparkAppHandle.getState)
if ("FINISHED".equals(sparkAppHandle.getState.toString)){
sparkAppHandle.stop
}
}
})
1条答案
按热度按时间lb3vh1jj1#
我的问题在添加hbase-0.92.1.jar和hive-hbase-handler-1.1.0-cdh5.13.0.jar后得到了解决。请查找以下工作代码:
}