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


##########
arrow/src/test/java/org/apache/iceberg/arrow/vectorized/ArrowReaderTest.java:
##########
@@ -263,6 +265,60 @@ public void testReadColumnFilter2() throws Exception {
         scan, NUM_ROWS_PER_MONTH, 12 * NUM_ROWS_PER_MONTH, 
ImmutableList.of("timestamp"));
   }
 
+  @Test
+  public void testIssue10275() throws Exception {
+    rowsWritten = Lists.newArrayList();
+    tables = new HadoopTables();
+    tableLocation = tempDir.toURI().toString();
+
+    // Define the initial table schema
+    final Schema customSchema =
+        new Schema(
+            Types.NestedField.required(1, "a", Types.IntegerType.get()),
+            Types.NestedField.optional(2, "b", Types.StringType.get()),
+            Types.NestedField.required(3, "c", Types.DecimalType.of(12, 3)));
+
+    // Create the table
+    PartitionSpec spec = PartitionSpec.builderFor(customSchema).build();
+    Table table1 = tables.create(customSchema, spec, tableLocation);
+
+    // Add one record to the table
+    GenericRecord rec = GenericRecord.create(customSchema);
+    rec.setField("a", 1);
+    rec.setField("b", "san diego");
+    rec.setField("c", new BigDecimal("1024.025"));
+    List<GenericRecord> genericRecords = Lists.newArrayList();
+    genericRecords.add(rec);
+
+    AppendFiles appendFiles = table1.newAppend();
+    appendFiles.appendFile(writeParquetFile(table1, genericRecords));
+    appendFiles.commit();
+
+    // Alter the table schema by adding a new, optional column

Review Comment:
   all of this can be simplified to
   ```
       Table table = tables.load(tableLocation);
       table.updateSchema().addColumn("a1", Types.IntegerType.get()).commit();
       TableScan scan = table.newScan().select("*");
   ```



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