huaxingao commented on code in PR #14153:
URL: https://github.com/apache/iceberg/pull/14153#discussion_r2379390099
##########
parquet/src/test/java/org/apache/iceberg/parquet/TestParquetDataWriter.java:
##########
@@ -113,13 +121,17 @@ public void testDataWriter() throws IOException {
List<Record> writtenRecords;
try (CloseableIterable<Record> reader =
Parquet.read(file.toInputFile())
- .project(SCHEMA)
- .createReaderFunc(fileSchema ->
GenericParquetReaders.buildReader(SCHEMA, fileSchema))
+ .project(schema)
+ .createReaderFunc(fileSchema ->
GenericParquetReaders.buildReader(schema, fileSchema))
.build()) {
writtenRecords = Lists.newArrayList(reader);
}
- assertThat(writtenRecords).as("Written records should
match").isEqualTo(records);
+ assertThat(writtenRecords).hasSameSizeAs(records);
+
+ for (int i = 0; i < records.size(); i++) {
+ InternalTestHelpers.assertEquals(schema.asStruct(), records.get(i),
writtenRecords.get(i));
Review Comment:
@deniskuzZ Logical round‑trip passes even without shredding, so the test
will succeed without calling `.variantShreddingFunc(variantShreddingFunc)`
(false positive). That’s why we should also assert the Parquet footer shows a
shredded schema . If you don’t have time to add this, I can have a followup PR
for this.
--
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]