SuccessChanges

Summary

  1. [SPARK-24033][SQL] Fix Mismatched of Window Frame (commit: d91410029331ff475843ea660b5f98ba15f23892) (details)
Commit d91410029331ff475843ea660b5f98ba15f23892 by gatorsmile
[SPARK-24033][SQL] Fix Mismatched of Window Frame
specifiedwindowframe(RowFrame, -1, -1)
## What changes were proposed in this pull request?
When the OffsetWindowFunction's frame is `UnaryMinus(Literal(1))` but
the specified window frame has been simplified to `Literal(-1)` by some
optimizer rules e.g., `ConstantFolding`. Thus, they do not match and
cause the following error:
``` org.apache.spark.sql.AnalysisException: Window Frame
specifiedwindowframe(RowFrame, -1, -1) must match the required frame
specifiedwindowframe(RowFrame, -1, -1); at
org.apache.spark.sql.catalyst.analysis.CheckAnalysis$class.failAnalysis(CheckAnalysis.scala:41)
at
org.apache.spark.sql.catalyst.analysis.Analyzer.failAnalysis(Analyzer.scala:91)
at
```
## How was this patch tested? Added a test
Author: gatorsmile <gatorsmile@gmail.com>
Closes #21115 from gatorsmile/fixLag.
(cherry picked from commit 7bc853d08973a6bd839ad2222911eb0a0f413677)
Signed-off-by: gatorsmile <gatorsmile@gmail.com>
(commit: d91410029331ff475843ea660b5f98ba15f23892)
The file was modifiedsql/core/src/test/scala/org/apache/spark/sql/DataFrameWindowFramesSuite.scala (diff)
The file was modifiedsql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/windowExpressions.scala (diff)