Spark Dataframe - Windowing Function - Lag & Lead for Insert & Update output
问题 I need to perform the below operation on dataframes using Windowing function Lag and Lead. For each Key, I need to perform the below Insert and update in the final output Insert Condition: 1. By Default, LAYER_NO=0 , needs to be written in output. 2. If there is any change in the value of COL1,COL2,COL3, with respective to its precious record,then that records needs to be written in output. Example: key_1 with layer_no=2, there is a change of value from 400 to 600 in COL3 Update Condition: 1.