divjotarora commented on code in PR #3711:
URL: https://github.com/apache/parquet-java/pull/3711#discussion_r3823048581
##########
parquet-column/src/main/java/org/apache/parquet/schema/Types.java:
##########
@@ -426,8 +429,38 @@ 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) {
Review Comment:
Good point, I agree this should be scoped to only throwing on invalid
combinations. Right now everything throws `IllegalStateException` so we can't
distinguish at this level. I added a new `UnsupportedLogicalTypeAnnotation`
exception to distinguish.
##########
parquet-hadoop/src/test/resources/invalid_type_combination.parquet:
##########
Review Comment:
Yes, I'll update the PR once that one is merged
--
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]