【发布时间】:2017-11-07 11:45:04
【问题描述】:
在 Spark Structured Streaming 中,我们可以使用 groupBy 对事件时间进行窗口操作,例如:
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.groupBy(
window($"timestamp", "10 minutes", "5 minutes"),
$"word"
).count()
groupByKey是否也支持窗口操作?
谢谢。
【问题讨论】:
标签: apache-spark spark-structured-streaming