2017-03-22 6 views
1

Ich habe diese Funktion mit Funken- und Scala:Apache Kudu mit Apache Spark NoSuchMethodError: exportAuthenticationCredentials

import org.apache.kudu.client.CreateTableOptions 
import org.apache.spark.sql.functions._ 
import org.apache.spark.sql.types._ 
import org.apache.spark.sql.{DataFrame, Dataset, Encoders, SparkSession} 
import org.apache.kudu.spark.kudu._ 

def save(df: DataFrame): Unit ={ 
    val kuduContext: KuduContext = new KuduContext("quickstart.cloudera:7051") 

    kuduContext.createTable(
     "test_table", df.schema, Seq("anotheKey", "id", "date"), 
     new CreateTableOptions() 
     .setNumReplicas(1)) 

    kuduContext.upsertRows(df, "test_table") 
    } 

Aber wenn die kuduContext zu schaffen versucht, löst eine Ausnahme:

Exception in thread "main" java.lang.NoSuchMethodError: org.apache.kudu.client.KuduClient.exportAuthenticationCredentials()[B 
    at org.apache.kudu.spark.kudu.KuduContext.<init>(KuduContext.scala:63) 
    at com.mypackge.myObject$.save(myObject.scala:24) 
    at com.mypackge.myObject$$anonfun$main$1.apply$mcV$sp(myObject.scala:59) 
    at com.mypackge.myObject$$anonfun$main$1.apply(myObject.scala:57) 
    at com.mypackge.myObject$$anonfun$main$1.apply(myObject.scala:57) 
    at com.mypackge.myObject$.time(myObject.scala:17) 
    at com.mypackge.myObject$.main(myObject.scala:57) 
    at com.mypackge.myObject.main(myObject.scala) 

Funken funktioniert ohne Probleme . Ich habe Kudu VM wie auf official docs beschrieben installiert und ich habe von Bash nach Impala-Instanz ohne ein Problem protokolliert.

Jemand hat eine Idee, was ich falsch mache?

Antwort

0

Das Problem war eine Abhängigkeit des Projekts mit einer alten Version von Kudu-Client (1.2.0), wenn ich Kudu-Spark 1.3.0 (die Kudu-Client 1.3.0 enthält) verwendet. Der Ausschluss von Kudu-Client von pom.xml war die Lösung.