Skip to content
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

Minor: Assert streaming_merge has non empty sort exprs #7795

Merged
merged 6 commits into from
Oct 16, 2023

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Oct 11, 2023

Which issue does this PR close?

Related to #7794

Rationale for this change

While debugging #7794 (which I think is a bad plan) the lack of Sort exprs caused very strange behavior that made it harder to debug.

Specifically, the merge code ended up passing bad indices to interleave which resulted in a panic far away from the source of the problem.

What changes are included in this PR?

  1. Return an internal error if no sort exprs are passed to streaming_merge
  2. Assert in RowCursor that there is at least one row
  3. Add some docs

Are these changes tested?

Yes by existing tests

Are there any user-facing changes?

No, only easier to debug failures

@alamb alamb marked this pull request as ready for review October 11, 2023 16:03
@alamb
Copy link
Contributor Author

alamb commented Oct 11, 2023

I verified this assert fires for my test case

@alamb
Copy link
Contributor Author

alamb commented Oct 13, 2023

@tustvold and @wiedld might you have a few minutes to review this PR?

Copy link
Member

@jackwener jackwener left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @alamb

datafusion/physical-plan/src/sorts/cursor.rs Outdated Show resolved Hide resolved
datafusion/physical-plan/src/sorts/cursor.rs Outdated Show resolved Hide resolved
alamb and others added 2 commits October 16, 2023 10:26
Co-authored-by: jakevin <jakevingoo@gmail.com>
Co-authored-by: Liang-Chi Hsieh <viirya@gmail.com>
@alamb alamb merged commit 7aa6b36 into apache:main Oct 16, 2023
22 checks passed
@alamb alamb deleted the alamb/assert_non_empty_sort branch October 16, 2023 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants