nastra commented on code in PR #10953:
URL: https://github.com/apache/iceberg/pull/10953#discussion_r1764468077


##########
arrow/src/test/java/org/apache/iceberg/arrow/vectorized/ArrowReaderTest.java:
##########
@@ -262,6 +264,120 @@ public void testReadColumnFilter2() throws Exception {
         scan, NUM_ROWS_PER_MONTH, 12 * NUM_ROWS_PER_MONTH, 
ImmutableList.of("timestamp"));
   }
 
+  @Test
+  public void testReadColumnThatDoesNotExistInParquetSchema() throws Exception 
{
+    rowsWritten = Lists.newArrayList();
+    tables = new HadoopTables();
+
+    List<Field> expectedFields =
+        ImmutableList.of(
+            new Field("a", new FieldType(false, MinorType.INT.getType(), 
null), null),
+            new Field("b", new FieldType(true, MinorType.INT.getType(), null), 
null),
+            new Field("z", new FieldType(true, MinorType.NULL.getType(), 
null), null));
+    org.apache.arrow.vector.types.pojo.Schema expectedSchema =
+        new org.apache.arrow.vector.types.pojo.Schema(expectedFields);
+
+    Schema originalSchema =
+        new Schema(
+            Types.NestedField.required(1, "a", Types.IntegerType.get()),
+            Types.NestedField.optional(2, "b", Types.IntegerType.get()));
+
+    PartitionSpec spec = PartitionSpec.builderFor(originalSchema).build();
+    Table table = tables.create(originalSchema, spec, tableLocation);
+
+    // Add one record to the table
+    {
+      GenericRecord rec = GenericRecord.create(originalSchema);
+      rec.setField("a", 1);
+      List<GenericRecord> genericRecords = Lists.newArrayList();
+      genericRecords.add(rec);
+
+      AppendFiles appendFiles = table.newAppend();
+      appendFiles.appendFile(writeParquetFile(table, genericRecords));
+      appendFiles.commit();
+    }
+
+    // Alter the table schema by adding a new, optional column.
+    // Do not add any data for this new column in the one existing row in the 
table, i.e. no default value
+    UpdateSchema updateSchema = table.updateSchema().addColumn("z", 
Types.IntegerType.get());
+    Schema newSchema = updateSchema.apply();
+    updateSchema.commit();
+
+    // Add one more record to the table
+    {

Review Comment:
   these can be removed



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