-
Notifications
You must be signed in to change notification settings - Fork 4.3k
GH-50910: [Parquet] Tolerate unrecognized logical/physical type combinations when reading #50909
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
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 |
|---|---|---|
|
|
@@ -453,10 +453,17 @@ std::unique_ptr<Node> PrimitiveNode::FromParquet(const void* opaque_element) { | |
| std::unique_ptr<PrimitiveNode> primitive_node; | ||
| if (element->__isset.logicalType) { | ||
| // updated writer with logical type present | ||
| primitive_node = std::unique_ptr<PrimitiveNode>( | ||
| new PrimitiveNode(element->name, LoadEnumSafe(&element->repetition_type), | ||
| LogicalType::FromThrift(element->logicalType), | ||
| LoadEnumSafe(&element->type), element->type_length, field_id)); | ||
| auto physical_type = LoadEnumSafe(&element->type); | ||
| auto logical_type = LogicalType::FromThrift(element->logicalType); | ||
| // Tolerate unrecognized logical/physical type combinations by dropping the logical type | ||
| // annotation. | ||
| if (logical_type && !logical_type->is_nested() && | ||
| !logical_type->is_applicable(physical_type, element->type_length)) { | ||
| logical_type = UndefinedLogicalType::Make(); | ||
|
Contributor
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. The java implementation seems to log in this branch any reason you aren't doing the same? it is a larger change but at some point we might want to make this configurable?
Author
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. Added a log here as well.
I'm not sure we need this to be configurable. It's not in parquet-java and likely would not be in arrow-rs based on previous changes made there. Is it standard to add such flags in this implementation? |
||
| } | ||
| primitive_node = std::unique_ptr<PrimitiveNode>(new PrimitiveNode( | ||
| element->name, LoadEnumSafe(&element->repetition_type), std::move(logical_type), | ||
| physical_type, element->type_length, field_id)); | ||
| } else if (element->__isset.converted_type) { | ||
| // legacy writer with converted type present | ||
| primitive_node = std::unique_ptr<PrimitiveNode>(new PrimitiveNode( | ||
|
|
||
|
Author
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. Changes in this file are due to pinning to a parquet-testing commit that contains the new file from apache/parquet-testing#122. The only file we actually use from this set is |
Uh oh!
There was an error while loading. Please reload this page.