geruh commented on code in PR #14081: URL: https://github.com/apache/iceberg/pull/14081#discussion_r2361265066
########## data/src/test/java/org/apache/iceberg/data/TestMetricsRowGroupFilter.java: ########## @@ -988,6 +1004,158 @@ public void testTransformFilter() { .isTrue(); } + @TestTemplate + public void testVariantFilterNotNull() throws IOException { + assumeThat(format).isEqualTo(FileFormat.PARQUET); + + Schema variantSchema = + new Schema( + required(1, "id", IntegerType.get()), + optional(2, "variant_field", Types.VariantType.get())); + + File parquetFile = new File(tempDir, "test-variant" + System.nanoTime()); + + OutputFile outFile = Files.localOutput(parquetFile); + try (FileAppender<GenericRecord> appender = + Parquet.write(outFile) + .schema(variantSchema) + .createWriterFunc(GenericParquetWriter::create) + .build()) { + + for (int i = 0; i < 10; i++) { + GenericRecord record = GenericRecord.create(variantSchema); + record.setField("id", i); + + if (i % 2 == 0) { + VariantMetadata metadata = Variants.metadata("field"); + ShreddedObject obj = Variants.object(metadata); + obj.put("field", Variants.of("value" + i)); + Variant variant = Variant.of(metadata, obj); + record.setField("variant_field", variant); + } + Review Comment: That is already above? Unless I'm missing something. -- 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