rdblue commented on a change in pull request #708: Bump Apache Parquet to 1.11.0
URL: https://github.com/apache/incubator-iceberg/pull/708#discussion_r371959583
##########
File path: parquet/src/main/java/org/apache/iceberg/parquet/ParquetWriter.java
##########
@@ -44,13 +44,33 @@
import org.apache.parquet.schema.MessageType;
class ParquetWriter<T> implements FileAppender<T>, Closeable {
- private static final DynConstructors.Ctor<PageWriteStore> pageStoreCtor =
DynConstructors
- .builder(PageWriteStore.class)
- .hiddenImpl("org.apache.parquet.hadoop.ColumnChunkPageWriteStore",
- CodecFactory.BytesCompressor.class,
- MessageType.class,
- ByteBufferAllocator.class)
- .build();
+
+ // We have one for Parquet 1.10 and one for 1.11. The signature changed, but
we still want
+ // to be compatible with both of them
+ private static DynConstructors.Ctor<PageWriteStore> pageStoreCtorParquet;
+
+ static {
+ try {
+ // Parquet 1.11
+ pageStoreCtorParquet = DynConstructors
+ .builder(PageWriteStore.class)
+ .hiddenImpl("org.apache.parquet.hadoop.ColumnChunkPageWriteStore",
Review comment:
Yeah, the purpose of `DynConstructors` and family is to make working with
reflection a lot easier. That's why it does things like dropping arguments if
there are too many (for exactly this situation) and creating NOOP stand-ins.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]