-
Notifications
You must be signed in to change notification settings - Fork 784
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
Fix projection in IPC reader #1736
Conversation
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.
Thanks @iyupeng. Can you add a related test with the change? I saw you already have reproducible example in the issue. Seems it is easy to make it as a test?
Hi @viirya , thanks for your comment. A new test is added to IPC reader in my last commit. |
Codecov Report
@@ Coverage Diff @@
## master #1736 +/- ##
=======================================
Coverage 83.31% 83.32%
=======================================
Files 196 195 -1
Lines 55961 56047 +86
=======================================
+ Hits 46625 46699 +74
- Misses 9336 9348 +12
Continue to review full report at Codecov.
|
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.
Looks a correct fix to me. I checked and compared it with create_array
.
Although I think we can still improve the test. For example, projection on complex types such as struct, list, union, etc.
Hi @viirya, I can add more commits to improve the test on projection. Please wait for some time before merging. |
Thank you @iyupeng |
Hi @viirya , the test for projection has been improved to check more data types. It is ready for review now. |
let struct_data_type = DataType::Struct(struct_fields); | ||
|
||
// define schema | ||
Schema::new(vec![ |
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.
👍
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.
Thanks @iyupeng! The new test looks good to me. I will leave this open for a while and will merge in next day if no more comments from other possible reviewers.
Thanks for the fix.
Merged, thanks! |
Which issue does this PR close?
Closes #1735 .
Rationale for this change
Fix possible panic caused by projection in IPC reader.
What changes are included in this PR?
Fix the function
read_record_batch
inarrow/src/ipc/reader.rs
.Are there any user-facing changes?
No.