How to apply lag function on streaming dataframe?
问题 I have a streaming dataframe having three columns time,col1,col2. I have to apply lag function on column2. I have tried following query. val w = org.apache.spark.sql.expressions.Window.oderBy("time") df.select(col("time"),col("col1"),lag("col3",1).over(w)) But It gives following exception org.apache.spark.sql.AnalysisException: Non-time-based windows are not supported on streaming DataFrames/Datasets How can i achieve this? Thanks in advance. 来源: https://stackoverflow.com/questions/46036845