-
Notifications
You must be signed in to change notification settings - Fork 847
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 nested Parquet 2-level lists correctly #6757
Changes from 2 commits
b064d0a
0cf2a58
90c7a88
ed8bf35
117f684
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -448,15 +448,21 @@ impl Visitor { | |||||
}; | ||||||
} | ||||||
|
||||||
// test to see if the repeated field is a struct or one-tuple | ||||||
let items = repeated_field.get_fields(); | ||||||
if items.len() != 1 | ||||||
|| repeated_field.name() == "array" | ||||||
|| repeated_field.name() == format!("{}_tuple", list_type.name()) | ||||||
|| (!repeated_field.is_list() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this check necessary, given we're in visit_list? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're testing if the child of the list we're processing is also
|
||||||
&& !repeated_field.has_single_repeated_child() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't do this because |
||||||
&& (repeated_field.name() == "array" | ||||||
|| repeated_field.name() == format!("{}_tuple", list_type.name()))) | ||||||
{ | ||||||
// If the repeated field is a group with multiple fields, then its type is the element type and elements are required. | ||||||
// If the repeated field is a group with multiple fields, then its type is the element | ||||||
// type and elements are required. | ||||||
// | ||||||
// If the repeated field is a group with one field and is named either array or uses the LIST-annotated group's name | ||||||
// with _tuple appended then the repeated type is the element type and elements are required. | ||||||
// If the repeated field is a group with one field and is named either array or uses | ||||||
// the LIST-annotated group's name with _tuple appended then the repeated type is the | ||||||
// element type and elements are required. But this rule only applies if the | ||||||
// repeated field is not annotated, and the single child field is not `repeated`. | ||||||
let context = VisitorContext { | ||||||
rep_level: context.rep_level, | ||||||
def_level, | ||||||
|
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.
Nice, thank you for putting a comment with the test data. I like this :)