RussellSpitzer commented on code in PR #14040:
URL: https://github.com/apache/iceberg/pull/14040#discussion_r2373094205
##########
parquet/src/main/java/org/apache/iceberg/data/parquet/BaseParquetReaders.java:
##########
@@ -75,8 +78,26 @@ protected ParquetValueReader<T> createReader(
}
}
- protected abstract ParquetValueReader<T> createStructReader(
- List<ParquetValueReader<?>> fieldReaders, Types.StructType structType);
+ /**
+ * This method can be overridden to provide a custom implementation which
also uses the fieldId of
+ * the Schema when creating the struct reader
+ */
+ protected ParquetValueReader<T> createStructReader(
+ List<ParquetValueReader<?>> fieldReaders, Types.StructType structType,
Integer fieldId) {
+ // Fallback to the signature without fieldId if not overridden
+ return createStructReader(fieldReaders, structType);
+ }
+
+ /**
+ * @deprecated will be removed in 1.11.0. Subclasses should override {@link
+ * #createStructReader(List, Types.StructType, Integer)} instead
+ */
+ @Deprecated
+ protected ParquetValueReader<T> createStructReader(
+ List<ParquetValueReader<?>> fieldReaders, Types.StructType structType) {
+ throw new UnsupportedOperationException(
Review Comment:
No, the method was "abstract" before so they would have had to have
implemented this method. I made it concrete here so I could remove the
implementations from the two child classes we currently have rather than
marking it deprecated there as well.
If you check the 3 arg version, it calls the subclasses 2 arg version if not
defined so existing behavior should be the same.
--
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]