使用withwatermark时报错
An error occurred while calling o2837.start.
: org.apache.spark.sql.AnalysisException: Append output mode not supported when there are streaming aggregations on streaming DataFrames/DataSets without watermark;;
就是Append输出模式不能用在aggregation中,但是使用watermark应该可以使用append 模式的
我的部分代码
解决:问题出现在这
.withWatermark 会生成一个新的dataset,然后watermark的信息则会储存在这个新的dataset中。 如果用word.name,或者其他reference 原来的dataset的方法,那dataset里没有watermark,所有用col就解决问题。