fix: window function range offset should be long instead of int#733
fix: window function range offset should be long instead of int#733huaxingao merged 10 commits intoapache:mainfrom
Conversation
| df.select( | ||
| $"key", | ||
| count("key").over( | ||
| sum("key").over( |
There was a problem hiding this comment.
So this test fails before this change?
There was a problem hiding this comment.
We currently don't support count so change to sum. Previously, even if the aggregate function is not supported, it still goes to the window frame code. In this PR, I return None directly if aggregate function is not supported.
| throw new IllegalArgumentException( | ||
| "Unsupported data type for window function row/range offset") |
There was a problem hiding this comment.
You will fail the query directly instead of falling back to Spark.
There was a problem hiding this comment.
changed to return None to fall back to Spark
2e03816 to
1f8a29e
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #733 +/- ##
=============================================
- Coverage 55.16% 34.16% -21.00%
- Complexity 857 881 +24
=============================================
Files 109 112 +3
Lines 10542 42949 +32407
Branches 2010 9491 +7481
=============================================
+ Hits 5815 14673 +8858
- Misses 3714 25274 +21560
- Partials 1013 3002 +1989 ☔ View full report in Codecov by Sentry. |
2777d18 to
0d84fd2
Compare
| WindowFrameUnits::Rows => { | ||
| WindowFrameBound::Preceding(ScalarValue::UInt64(None)) | ||
| } | ||
| WindowFrameUnits::Range | WindowFrameUnits::Groups => { |
There was a problem hiding this comment.
We don't use Groups, but if we don't specify this case, UpperFrameBoundStruct::UnboundedFollowing(_) => match units fails with pattern datafusion_expr::WindowFrameUnits::Groups not covered.
There was a problem hiding this comment.
Can we add it as separate pattern branch and return error?
| if (partitionColumnNames.toSet != orderColumnNames.toSet) { | ||
| withInfo(op, "Partitioning and sorting specifications do not match") | ||
| return false | ||
| } |
There was a problem hiding this comment.
Maybe check the partition column and order column one by one instead of a set? I'm not sure if (PARTITION BY k, v ORDER BY v, k) work.
94c7739 to
f801106
Compare
f801106 to
92b5c58
Compare
|
Merged. Thanks @viirya @kazuyukitanimura |
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes apache#123` indicates that this PR will close issue apache#123. --> N/A ## Rationale for this change <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. --> Apply OSS 0.3.0 changes. ## What changes are included in this PR? <!-- There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR. --> ``` 84cccf7 docs: Add notes for IntelliJ code size limits for code inspections. (apache#985) dcc4a8a fix: The spilled_bytes metric of CometSortExec should be size instead of time (apache#984) f64553b chore: fix compatibility guide (apache#978) 0ee7df8 chore: Enable additional CreateArray tests (apache#928) a690e9d perf: Remove one redundant CopyExec for SMJ (apache#962) a8156b5 chore: update rem expression guide (apache#976) 317a534 fix: Use the number of rows from underlying arrays instead of logical row count from RecordBatch (apache#972) 22561c4 doc: add documentation interlinks (apache#975) b4de8e0 chore: Update benchmarks results based on 0.3.0-rc1 (apache#969) 94093f3 chore: fix publish-to-maven script (apache#966) f31f6cc Generate changelog for 0.3.0 release (apache#964) 5663fc2 fix: div and rem by negative zero (apache#960) 50517f6 perf: Optimize decimal precision check in decimal aggregates (sum and avg) (apache#952) 5b3f7bc fix: CometScanExec on Spark 3.5.2 (apache#915) 8410c71 chore: clarify tarball installation (apache#959) 459b2b0 fix: window function range offset should be long instead of int (apache#733) ``` ## How are these changes tested? <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? -->
Which issue does this PR close?
Closes #.
Rationale for this change
What changes are included in this PR?
How are these changes tested?