Guosmilesmile commented on code in PR #15265:
URL: https://github.com/apache/iceberg/pull/15265#discussion_r2853527278
##########
flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/data/FlinkParquetReaders.java:
##########
@@ -853,4 +868,29 @@ public double[] toDoubleArray() {
return ArrayUtil.toPrimitive((Double[]) values);
}
}
+
+ /** Variant reader to convert from Iceberg Variant to Flink Variant */
+ private static class VariantReader
+ extends DelegatingValueReader<org.apache.iceberg.variants.Variant,
Variant> {
+ @SuppressWarnings("unchecked")
+ private VariantReader(ParquetValueReader<?> reader) {
+ super((ParquetValueReader<org.apache.iceberg.variants.Variant>) reader);
+ }
+
+ @Override
+ public Variant read(Variant reuse) {
+ org.apache.iceberg.variants.Variant icebergVariant =
super.readFromDelegate(null);
+
+ byte[] metadataBytes = new byte[icebergVariant.metadata().sizeInBytes()];
+ ByteBuffer metadataBuffer =
+
ByteBuffer.wrap(metadataBytes).order(java.nio.ByteOrder.LITTLE_ENDIAN);
Review Comment:
Remove it.
--
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]