-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ARROW-11323: [Rust][DataFusion] Allow sort queries to return no results #9275
Conversation
Codecov Report
@@ Coverage Diff @@
## master #9275 +/- ##
=======================================
Coverage 81.68% 81.68%
=======================================
Files 215 215
Lines 52561 52577 +16
=======================================
+ Hits 42935 42949 +14
- Misses 9626 9628 +2
Continue to review full report at Codecov.
|
@@ -141,7 +141,10 @@ fn sort_batches( | |||
batches: &Vec<RecordBatch>, | |||
schema: &SchemaRef, | |||
expr: &[PhysicalSortExpr], | |||
) -> ArrowResult<RecordBatch> { | |||
) -> ArrowResult<Option<RecordBatch>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that I did not use create_empty_record_batch
to create a 0 row record batch (the approach taken in hash_aggregrate.rs) https://github.com/apache/arrow/blob/master/rust/datafusion/src/physical_plan/hash_aggregate.rs#L827, as the approach in this PR will support any data type now or in the future.
@jorgecarleitao and @andygrove -- if you have time, could you review this (small PR)? It is something I hit while trying to upgrade my downstream IOx project to use the latest arrow/datafusion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Sorry for the delay. I had reviewed it yesterday but forgot to post here :/
Thanks @jorgecarleitao ! |
Prior to this PR, if a plan had an ORDER BY (Sort) that got no input rows, you would get an output error. Now the test passes and produces the (expected) no output rows Closes #9275 from alamb/alamb/ARROW-11323-empty-results Authored-by: Andrew Lamb <andrew@nerdnetworks.org> Signed-off-by: Andrew Lamb <andrew@nerdnetworks.org>
Prior to this PR, if a plan had an ORDER BY (Sort) that got no input rows, you would get an output error. Now the test passes and produces the (expected) no output rows Closes apache#9275 from alamb/alamb/ARROW-11323-empty-results Authored-by: Andrew Lamb <andrew@nerdnetworks.org> Signed-off-by: Andrew Lamb <andrew@nerdnetworks.org>
Prior to this PR, if a plan had an ORDER BY (Sort) that got no input rows, you would get an output error. Now the test passes and produces the (expected) no output rows Closes apache#9275 from alamb/alamb/ARROW-11323-empty-results Authored-by: Andrew Lamb <andrew@nerdnetworks.org> Signed-off-by: Andrew Lamb <andrew@nerdnetworks.org>
Prior to this PR, if a plan had an ORDER BY (Sort) that got no input rows, you would get an output error.
Now the test passes and produces the (expected) no output rows