G.S*_*leh 5 scala apache-spark
我正在尝试编译一个简单的 scala 程序,我正在使用 StreamingContext ,这是我的代码片段:
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
import org.apache.spark.scheduler.SparkListener
import org.apache.spark.scheduler.SparkListenerStageCompleted
import org.apache.spark.streaming.StreamingContext._ //error:object streaming is not a member of package org.apache.spark
object FileCount {
def main(args: Array[String]) {
val conf = new SparkConf()
.setAppName("File Count")
.setMaster("local")
val sc = new SparkContext(conf)
val textFile = sc.textFile(args(0))
val ssc = new StreamingContext(sc, Seconds(10)) //error : not found: type StreamingContext
sc.stop()
}
}
Run Code Online (Sandbox Code Playgroud)
我有这两个错误:
object streaming is not a member of package org.apache.spark
Run Code Online (Sandbox Code Playgroud)
和
not found: type StreamingContext
Run Code Online (Sandbox Code Playgroud)
任何帮助请!
归档时间: |
|
查看次数: |
7558 次 |
最近记录: |