GitHub user gatorsmile opened a pull request:

    https://github.com/apache/spark/pull/21115

    [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

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/gatorsmile/spark fixLag

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/21115.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #21115
    
----
commit 8e4c92171dfebb063932764b5fecc6ec7f3de0a8
Author: gatorsmile <gatorsmile@...>
Date:   2018-04-20T17:45:47Z

    fix

----


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to