Commit 1bb4143
[SPARK-45430] Fix for FramelessOffsetWindowFunction when IGNORE NULLS and offset > rowCount
### What changes were proposed in this pull request?
This is a fix for the failure when function that utilized `FramelessOffsetWindowFunctionFrame` is used with `ignoreNulls = true` and `offset > rowCount`.
e.g.
```
select x, lead(x, 5) IGNORE NULLS over (order by x) from (select explode(sequence(1, 3)) x)
```
### Why are the changes needed?
Fix existing bug
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Modify existing unit test to cover this case
### Was this patch authored or co-authored using generative AI tooling?
No
Closes #43236 from vitaliili-db/SPARK-45430.
Authored-by: Vitalii Li <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
(cherry picked from commit 32e1e58)
Signed-off-by: Wenchen Fan <[email protected]>1 parent 746f936 commit 1bb4143
File tree
2 files changed
+27
-19
lines changed- sql/core/src
- main/scala/org/apache/spark/sql/execution/window
- test/scala/org/apache/spark/sql
2 files changed
+27
-19
lines changedLines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
205 | 209 | | |
206 | 210 | | |
207 | 211 | | |
| |||
Lines changed: 22 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
814 | 814 | | |
815 | 815 | | |
816 | 816 | | |
| 817 | + | |
| 818 | + | |
817 | 819 | | |
818 | 820 | | |
819 | 821 | | |
820 | 822 | | |
821 | 823 | | |
822 | 824 | | |
823 | 825 | | |
| 826 | + | |
| 827 | + | |
824 | 828 | | |
825 | 829 | | |
826 | 830 | | |
827 | | - | |
828 | | - | |
829 | | - | |
830 | | - | |
831 | | - | |
832 | | - | |
833 | | - | |
834 | | - | |
835 | | - | |
836 | | - | |
837 | | - | |
838 | | - | |
839 | | - | |
840 | | - | |
841 | | - | |
842 | | - | |
843 | | - | |
844 | | - | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
845 | 849 | | |
846 | 850 | | |
847 | 851 | | |
| |||
0 commit comments