Ich kann den Scala-Code nicht kompilieren, ein Abhängigkeitsfehler taucht auf!Abhängigkeit nicht aufgelöst
aber ich eine andere Beispielanwendung haben, die mit vorhandenen Setup funktioniert gut, wird dieser Code nicht auf dem gleichen Bogen Arbeits
: Fehlerprotokolle
:sbt compile
[info] Set current project to firstScalaScript (in build file:/home/abu/Current%20Workspace/)
[info] Updating {file:/home/abu/Current%20Workspace/}current-workspace...
[info] Resolving org.apache.spark#spark-core;2.0.1 ...
[warn] module not found: org.apache.spark#spark-core;2.0.1
[warn] ==== local: tried
[warn] /home/abu/.ivy2/local/org.apache.spark/spark-core/2.0.1/ivys/ivy.xml
[warn] ==== public: tried
[warn] https://repo1.maven.org/maven2/org/apache/spark/spark-core/2.0.1/spark-core-2.0.1.pom
[warn] ==== Akka Repository: tried
[warn] http://repo.akka.io/releases/org/apache/spark/spark-core/2.0.1/spark-core-2.0.1.pom
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.apache.spark#spark-core;2.0.1: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Unresolved dependencies path:
mein Code:
import scala.io.Source._
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.SparkConf
import org.apache.log4j.Logger
import org.apache.log4j.Level
import org.apache.spark.rdd.RDD
import org.apache.hadoop.io.compress.GzipCodec
object firstScalaScript{
def main(args: Array[String])
{
val sc=new SparkContext(new SparkConf())
val rdd=sc.textFile("e.txt,r.txt").collect()
//rdd.saveAsTextFile("confirmshot.txt"); sc.stop()
}
}
mein Code: import scala.io.Source._ Import org.apache.spark.SparkContext Import org.apache.spark.SparkContext._ Import org.apache.spark.SparkConf Import org.apache.log4j .Logger import org.apache.log4j.Level import org.apache.spark.rdd.RDD import org.apache.hadoop.io.compress.GzipCodec Objekt firstScalaScript { def main (args: Array [String]) { \t val sc = neu SparkContext (new SparkConf()) \t val rdd = sc.textDatei ("e.txt, r.txt"). Collect() \t //rdd.saveAsTextFile("confirmshot.txt "); \t sc.stop() \t} } –
Bearbeiten Sie Ihre Frage mit Ihrem Code-Block (und die richtige Formatierung einrichten) anstelle von Kommentaren für den gleichen Zweck. –