2017-06-13 10 views
0

Ich versuche, ein Diagramm mit Funken graphframeGraphFrame: fehlende oder ungültige Abhängigkeit erkannt beim Laden der Klassendatei

hier zu schaffen, ist der Code:

import org.graphframes._ 

// Node DataFrames 
val v = sqlContext.createDataFrame(List(
    ("a", "Alice", 34), 
    ("b", "Bob", 36), 
    ("c", "Charlie", 30), 
    ("d", "David", 29), 
    ("e", "Esther", 32), 
    ("f", "Fanny", 36), 
    ("g", "Gabby", 60) 
)).toDF("id", "name", "age") 

// Edge DataFrame 
val e = sqlContext.createDataFrame(List(
    ("a", "b", "friend"), 
    ("b", "c", "follow"), 
    ("c", "b", "follow"), 
    ("f", "c", "follow"), 
    ("e", "f", "follow"), 
    ("e", "d", "friend"), 
    ("d", "a", "friend"), 
    ("a", "e", "friend") 
)).toDF("src", "dst", "relationship") 

// Create a GraphFrame 
val g = GraphFrame(v, e) 

Aber das ist der Fehler Ich erhalte:

error: missing or invalid dependency detected while loading class file 'GraphFrame.class'. Could not access type Logging in package org.apache.spark, because it (or its dependencies) are missing. Check your build definition for missing or conflicting dependencies. (Re-run with -Ylog-classpath to see the problematic classpath.) A full rebuild may help if 'GraphFrame.class' was compiled against an incompatible version of org.apache.spark.

Ich benutze Apache Spark 2.1 und Scala 2.11. Irgendwelche Vorschläge, was kann das Problem sein?

Antwort

0

herunterladen folgenden Pakete von Maven zentralen Repo

com.typesafe.scala-logging_scala-logging-api_2.11-2.1.2.jar  
graphframes_graphframes-0.5.0-spark2.1-s_2.11.jar 
org.slf4j_slf4j-api-1.7.7.jar 
com.typesafe.scala-logging_scala-logging-slf4j_2.11-2.1.2.jar 
org.scala-lang_scala-reflect-2.11.0.jar 

Fügen Sie den folgenden auf Ihre Funken-default.conf-Datei (kommagetrennte Liste von absoluten Pfad, in dem die oben heruntergeladen Gläser befinden)

spark.jars   path_2_jar/org.slf4j_slf4j-api-1.7.7.jar, path_2_jar/org.scala-lang_scala-reflect-2.11.0.jar, path_2_jar/graphframes_graphframes-0.5.0-spark2.1-s_2.11.jar, path_2_jar/com.typesafe.scala-logging_scala-logging-slf4j_2.11-2.1.2.jar, path_2_jar/com.typesafe.scala-logging_scala-logging-api_2.11-2.1.2.jar 
Verwandte Themen