滑动窗口间隔出错

pxy2qtax  于 2021-05-18  发布在  Spark
关注(0)|答案(0)|浏览(281)

目前我有一个使用滑动窗口的流,可以通过这样的伪代码来减少。

val df = stream.withColumn("processingTime", current_timestamp()).
           .groupBy(// window of "5 min" as interval and 10 seconds slide Duration)
           .agg(// some aggregation here)
           .writeStream.forEachBatch( (batch, batchId) => {
                // Second aggregation and write batch to console
           }).trigger(Triggers.Processing("0 second"))
           .start()

我希望带有print out的代码每10秒控制一个批,但它总是每20秒执行一次。
可能的原因是什么?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题