divjotarora commented on code in PR #3711:
URL: https://github.com/apache/parquet-java/pull/3711#discussion_r3805601979


##########
parquet-column/src/main/java/org/apache/parquet/schema/Types.java:
##########
@@ -426,8 +429,40 @@ public THIS columnOrder(ColumnOrder columnOrder) {
       return self();
     }
 
+    /**
+     * When set, an unsupported combination results in the logical type 
annotation being dropped
+     * rather than throwing. The associated statistics are also forcefully 
ignored by setting the
+     * column order to {@link ColumnOrderName#UNDEFINED}.
+     *
+     * @return this builder for method chaining
+     */
+    public THIS dropUnsupportedLogicalTypeCombinations() {
+      this.dropUnsupportedLogicalTypeCombinations = true;
+      return self();
+    }
+
     @Override
     protected PrimitiveType build(String name) {
+      try {
+        return validateAndBuild(name);
+      } catch (IllegalStateException e) {
+        boolean canDrop = dropUnsupportedLogicalTypeCombinations
+            && !(logicalTypeAnnotation instanceof 
LogicalTypeAnnotation.DecimalLogicalTypeAnnotation);

Review Comment:
   This is leftover from an old version of the implementation, removed the 
special case



##########
parquet-hadoop/src/test/java/org/apache/parquet/format/converter/TestParquetMetadataConverter.java:
##########
@@ -2279,4 +2283,62 @@ public void testColumnIndexNanCountsRoundTrip() {
     assertThat(roundTrip).isNotNull();
     assertThat(roundTrip.getNanCounts()).containsExactly(1L, 0L, 0L);
   }
+
+  @Test

Review Comment:
   Added a new `TestReadInvalidTypeCombination`



##########
parquet-column/src/main/java/org/apache/parquet/schema/Types.java:
##########
@@ -426,8 +429,40 @@ public THIS columnOrder(ColumnOrder columnOrder) {
       return self();
     }
 
+    /**
+     * When set, an unsupported combination results in the logical type 
annotation being dropped
+     * rather than throwing. The associated statistics are also forcefully 
ignored by setting the
+     * column order to {@link ColumnOrderName#UNDEFINED}.
+     *
+     * @return this builder for method chaining
+     */
+    public THIS dropUnsupportedLogicalTypeCombinations() {

Review Comment:
   This is called directly in `ParquetMetadataConverter.java` 
[here](https://github.com/apache/parquet-java/pull/3711/changes#diff-1afc9f89a782ddd4e7cd17546ca048954091627d7a31597ab88892eb2a7a76abR2065-R2066)



-- 
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