【发布时间】:2020-02-27 05:34:54
【问题描述】:
我正在尝试编译一个简单的 scala 程序并且我正在使用 StreamingContext ,这是我的代码的 sn-p:
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()
}
}
我有这两个错误:
object streaming is not a member of package org.apache.spark
和
not found: type StreamingContext
请帮忙!!
【问题讨论】:
标签: scala apache-spark