joyhaldar commented on code in PR #17610:
URL: https://github.com/apache/iceberg/pull/17610#discussion_r3781107676
##########
data/src/test/java/org/apache/iceberg/data/BaseFormatModelTests.java:
##########
@@ -114,6 +114,19 @@ protected boolean supportsBatchReads() {
return false;
}
+ protected boolean readOnly() {
+ return false;
+ }
+
+ protected Set<FileFormat> supportedFormats() {
Review Comment:
Thank you for the suggestion @pvary I tried it out and here's what I found:
Redefining `FILE_FORMATS` in the subclass works as you described, those
tests drop AVRO with no base class changes.
Redefining `FORMAT_AND_GENERATOR` doesn't work as is, because it references
[DataGenerators](https://github.com/apache/iceberg/blob/main/data/src/test/java/org/apache/iceberg/data/DataGenerators.java),
which is package-private in `org.apache.iceberg.data` while
`TestSparkVectorizedFormatModel` is in `org.apache.iceberg.spark.data`.
I tried making
[DataGenerators](https://github.com/apache/iceberg/blob/35889387c8c6ff0a3f57d17a304709dc1b7d9340/data/src/test/java/org/apache/iceberg/data/DataGenerators.java#L35),
[DataGenerators.ALL](https://github.com/apache/iceberg/blob/35889387c8c6ff0a3f57d17a304709dc1b7d9340/data/src/test/java/org/apache/iceberg/data/DataGenerators.java#L37)
and the
[DataGenerator](https://github.com/apache/iceberg/blob/35889387c8c6ff0a3f57d17a304709dc1b7d9340/data/src/test/java/org/apache/iceberg/data/DataGenerator.java#L25)
interface public, and with that both fields can be redefined in the subclass.
All AVRO cases are gone and I could remove `supportedFormats()` and the per
test assumptions entirely. `TestSparkFormatModel` and `TestFlinkFormatModel`
still pass.
Would you like me to go with that, or would you rather avoid widening the
visibility of those test classes?
--
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]