yjshen opened a new pull request, #2182:
URL: https://github.com/apache/arrow-datafusion/pull/2182
# 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 #123`
indicates that this PR will close issue #123.
-->
Closes #.
# Rationale for this change
While sorting by a column with a great many repetition values, we may get
non-continuous indices from a batch to output. This fails the current
assumption that indices are always continuous, and make `extend` output wrong
slices.
For example, in our test on a 1TB TPC-DS dataset, sort by
`inventory.inv_date_sk`. we are witnessing
```
CompositeIndex { batch_idx: 68, row_idx: 4164 }
CompositeIndex { batch_idx: 68, row_idx: 4293 }
CompositeIndex { batch_idx: 68, row_idx: 4294 }
CompositeIndex { batch_idx: 68, row_idx: 4295 }
CompositeIndex { batch_idx: 68, row_idx: 4296 }
CompositeIndex { batch_idx: 68, row_idx: 4297 }
```
using start_row_idx, 4164 with length 6 is wrong, since rows with indices
from 4165 to 4169 should be output elsewhere, and it's likely 4296 or 4297 are
pointing to the next sort key.
# 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.
-->
Bugfix along with the minimum parquet test file that could reproduce the bug.
# Are there any user-facing changes?
No.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]