jbonofre commented on code in PR #11839:
URL: https://github.com/apache/iceberg/pull/11839#discussion_r1927419995


##########
flink/v1.20/flink/src/test/java/org/apache/iceberg/flink/data/TestFlinkParquetReader.java:
##########
@@ -199,41 +204,53 @@ public void testTwoLevelList() throws IOException {
     }
   }
 
-  private void writeAndValidate(Iterable<Record> iterable, Schema schema) 
throws IOException {
+  private void writeAndValidate(
+      Iterable<Record> iterable, Schema writeSchema, Schema expectedSchema) 
throws IOException {
     File testFile = File.createTempFile("junit", null, temp.toFile());
     assertThat(testFile.delete()).isTrue();
 
     try (FileAppender<Record> writer =
         Parquet.write(Files.localOutput(testFile))
-            .schema(schema)
+            .schema(writeSchema)
             .createWriterFunc(GenericParquetWriter::buildWriter)
             .build()) {
       writer.addAll(iterable);
     }
 
     try (CloseableIterable<RowData> reader =
         Parquet.read(Files.localInput(testFile))
-            .project(schema)
-            .createReaderFunc(type -> FlinkParquetReaders.buildReader(schema, 
type))
+            .project((expectedSchema != null) ? expectedSchema : writeSchema)
+            .createReaderFunc(
+                type ->
+                    FlinkParquetReaders.buildReader(
+                        (expectedSchema != null) ? expectedSchema : 
writeSchema, type))

Review Comment:
   I can update this way for sure. Thanks for the suggestion !



-- 
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

Reply via email to