-
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
Read/write nested dictionary under map in ipc stream reader/writer #1583
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1583 +/- ##
==========================================
+ Coverage 82.87% 82.94% +0.07%
==========================================
Files 193 193
Lines 55304 55411 +107
==========================================
+ Hits 45832 45962 +130
+ Misses 9472 9449 -23
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.
This looks good to me, left some additional test suggestions
arrow/src/ipc/reader.rs
Outdated
@@ -1481,4 +1481,55 @@ mod tests { | |||
let output_batch = roundtrip_ipc_stream(&input_batch); | |||
assert_eq!(input_batch, output_batch); | |||
} | |||
|
|||
#[test] | |||
fn test_roundtrip_stream_nested_dict_dict_in_map() { |
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.
fn test_roundtrip_stream_nested_dict_dict_in_map() { | |
fn test_roundtrip_stream_nested_dict_of_map_of_dict() { |
arrow/src/ipc/reader.rs
Outdated
let dict_array = DictionaryArray::<Int8Type>::try_new(&keys, &values).unwrap(); | ||
|
||
let keys_array = Int32Array::from_iter_values([0, 0, 1, 2, 0, 1]); | ||
let keys_field = Field::new("keys", DataType::Int32, false); |
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.
Might want to test dictionary encoded keys as well
arrow/src/ipc/reader.rs
Outdated
let values_field = Field::new_dict( | ||
"values", | ||
DataType::Dictionary(Box::new(DataType::Int8), Box::new(DataType::Utf8)), | ||
false, |
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.
Could also test some NULLs
Thank you @tustvold. Revised based on the suggestions. |
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.
Will get this in once CI finishes chugging along
Thank you @tustvold |
Which issue does this PR close?
Closes #1582.
Rationale for this change
What changes are included in this PR?
Are there any user-facing changes?