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_r370286795
##########
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:
These can be added to the same builder to avoid the need for a `static`
block like this.
```java
private static DynConstructors.Ctor<PageWriteStore> ctor =
DynConstructors.builder(PageWriteStore.class)
.hiddenImpl(...) // 1.11
.hiddenImpl(...) // 1.10
.build()
```
----------------------------------------------------------------
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]