You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "emkornfield (via GitHub)" <gi...@apache.org> on 2026/09/23 23:31:50 UTC
Re: [PR] GH-50910: [Parquet] Tolerate unrecognized logical/physical type combinations when reading [arrow]
emkornfield commented on code in PR #50909:
URL: https://github.com/apache/arrow/pull/50909#discussion_r4088318861
##########
cpp/src/parquet/schema.cc:
##########
@@ -453,10 +453,21 @@ 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_applicable(physical_type, element->type_length)) {
+ ARROW_LOG(WARNING) << "Dropping unsupported logical type "
Review Comment:
I think this might be the first log statement we have in Parquet code. @wgtmac @pitrou any concerns with adding it, it seems useful?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org