今天運行Spark官網的Demo http://spark.apache.org/docs/latest/structured-streaming-programming-guide.html#handling-late-data-and-watermarking
代碼如下:
import spark.implicits._
val words = ... // streaming DataFrame of schema { timestamp: Timestamp, word: String }
// Group the data by window and word and compute the count of each group
val windowedCounts = words
.withWatermark("timestamp", "10 minutes")
.groupBy(
window($"timestamp", "10 minutes", "5 minutes"),
$"word")
.count()
然后提示window不存在,請問這個需要引入什么包么?看官方也沒說,誰能幫幫我,在線等~
uj5u.com熱心網友回復:
https://mvnrepository.com/artifact/org.apache.spark/spark-streaming選擇自己的版本
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/14169.html
標籤:Spark
下一篇:docker的ipv6訪問問題
