brkyvz commented on code in PR #3608:
URL: https://github.com/apache/parquet-java/pull/3608#discussion_r4426846446


##########
parquet-hadoop/src/main/java/org/apache/parquet/format/converter/ParquetMetadataConverter.java:
##########
@@ -2184,7 +2194,15 @@ && getLogicalTypeAnnotation(schemaElement.logicalType) 
!= null)
         childBuilder.id(schemaElement.field_id);
       }
 
-      childBuilder.named(schemaElement.name);
+      try {
+        childBuilder.named(schemaElement.name);
+      } catch (IllegalArgumentException e) {
+        if (!fileLogicalType) {
+          throw e;
+        }
+        LOG.warn("Dropping malformed FILE logical type annotation on group 
{}", schemaElement.name, e);
+        childBuilder.as((LogicalTypeAnnotation) 
null).named(schemaElement.name);
+      }

Review Comment:
   Removed the FILE-specific catch that dropped the annotation. Invalid fields 
in a FILE-annotated group now propagate the schema-validation error. FILE on a 
primitive still follows the
            existing unsupported-annotation handling. 
[testMalformedFileLogicalTypeFailsOnRead and 
testFileLogicalTypeOnPrimitiveIsIgnored](https://github.com/apache/parquet-java/blob/bab237a1f
           
7b57457052f520f7cd5dae84b211e16/parquet-hadoop/src/test/java/org/apache/parquet/format/converter/TestParquetMetadataConverter.java#L2506)
 cover both behaviors.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to