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

Regression: Merge assertion: 'assertion failed: i < self.len()' in array_primitive.rs while merging non overlapping streams #1676

Closed
alamb opened this issue Jan 25, 2022 · 2 comments · Fixed by #1678
Assignees
Labels
bug Something isn't working

Comments

@alamb
Copy link
Contributor

alamb commented Jan 25, 2022

Describe the bug
If we try to merge two streams that are non overlapping (e.g. 0..20 and 20..40) then the following panic is produced:

thread 'test_merge_2_no_overlap' panicked at 'assertion failed: i < self.len()', /Users/alamb/.cargo/registry/src/github.jparrowsec.cn-1ecc6299db9ec823/arrow-8.0.0/src/array/array_primitive.rs:120:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Note this won't affect any users of DataFusion unless they are using externalized sort that @yjshen has recently been working on or directly use SortPreservingMergeStream as IOx does

To Reproduce
See fuzztester PR: #1678

Expected behavior
Correct answers come out, with no panic

Additional context
Found in some of our tests in IOx: https://github.com/influxdata/influxdb_iox/issues/3530

I am fairly confident it is a corner case in the code from #1596

@yjshen
Copy link
Member

yjshen commented Jan 26, 2022

It's caused by inserting an empty record batch, I think. The current sort will not be affected since empty batches are eliminated while inserting. Proposed fix in alamb#4

@alamb
Copy link
Contributor Author

alamb commented Jan 26, 2022

I have incorporated alamb#4 into #1678

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants