eric-maynard commented on code in PR #13290: URL: https://github.com/apache/iceberg/pull/13290#discussion_r2155036575
########## arrow/src/main/java/org/apache/iceberg/arrow/vectorized/parquet/VectorizedPageIterator.java: ########## @@ -65,13 +64,13 @@ public void setAllPagesDictEncoded(boolean allDictEncoded) { @Override protected void reset() { super.reset(); - this.plainValuesReader = null; + this.valuesReader = null; this.vectorizedDefinitionLevelReader = null; } @Override protected void initDataReader(Encoding dataEncoding, ByteBufferInputStream in, int valueCount) { - ValuesReader previousReader = plainValuesReader; + ValuesReader previousReader = (ValuesReader) valuesReader; Review Comment: Yeah currently we need the cast due to a bit of a Java-based pickle, happy to change this up if you have any ideas on how it can be improved. * `VectorizedValuesReader` is currently not bound to `ValuesReader`. We can't just make `VectorizedValuesReader` extend `ValuesReader` because the former is an interface and the latter is a class. * We can't just make `VectorizedValuesReader` an ABC because then classes like `VectorizedPlainValuesReader` can't extend both it and `PlainValuesReader`. * Since `ValuesReader` is an ABC in Parquet but `VectorizedValuesReader` is an interface, we can't easily mark `valuesReader` as being both types. - We _could_ create a generic method and bind the type to `<T extends ValuesReader & VectorizedValuesReader>` but that feels clunky I see a couple of ways out of this but they mostly involve copying a lot of code and I thought this cast wasn't too high of a price to pay. It does mean that we need to more or less keep `VectorizedValuesReader` in sync with `ValuesReader` if it evolves. This issue is inherited from #9772. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org