xr-chen commented on code in PR #766:
URL: https://github.com/apache/incubator-xtable/pull/766#discussion_r2638234109


##########
xtable-core/src/test/java/org/apache/xtable/ITConversionController.java:
##########
@@ -746,6 +746,48 @@ public void testIcebergCorruptedSnapshotRecovery() throws 
Exception {
     }
   }
 
+  @Test
+  public void testColumnMappingEnabledDeltaToIceberg() {
+    String tableName = getTableName();
+    ConversionSourceProvider<?> conversionSourceProvider = 
getConversionSourceProvider(DELTA);
+    try (TestSparkDeltaTable table =
+        TestSparkDeltaTable.forColumnMappingEnabled(tableName, tempDir, 
sparkSession, null)) {
+      table.insertRows(20);
+      ConversionController conversionController =
+          new ConversionController(jsc.hadoopConfiguration());
+      ConversionConfig conversionConfig =
+          getTableSyncConfig(
+              DELTA,
+              SyncMode.INCREMENTAL,
+              tableName,
+              table,
+              Collections.singletonList(ICEBERG),
+              null,
+              null);
+      conversionController.sync(conversionConfig, conversionSourceProvider);
+      table.insertRows(10);
+      conversionController.sync(conversionConfig, conversionSourceProvider);
+      table.insertRows(10);
+      conversionController.sync(conversionConfig, conversionSourceProvider);
+      checkDatasetEquivalence(DELTA, table, 
Collections.singletonList(ICEBERG), 40);
+
+      table.dropColumn("long_field");
+      table.insertRows(10);
+      conversionController.sync(conversionConfig, conversionSourceProvider);
+      checkDatasetEquivalence(DELTA, table, 
Collections.singletonList(ICEBERG), 50);
+
+      table.renameColumn("double_field", "scores");

Review Comment:
   The final schema does match the expected results. I can't see the dropped 
column `long_field` anymore, the `double_field` column is renamed to `scores`, 
and a new column `city` is added
   <img width="703" height="586" alt="Screenshot 2025-12-21 at 4 07 05 PM" 
src="https://github.com/user-attachments/assets/eb0e8835-697b-4aa2-a13e-7721fbe3e186";
 />
   For the data files, they still use random strings as column names; nothing 
should be changed after Delta's schema evolution.
   <img width="1020" height="566" alt="Screenshot 2025-12-21 at 4 07 41 PM" 
src="https://github.com/user-attachments/assets/0246f50d-4ccf-4cf3-8735-f6674131e717";
 />
   



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

Reply via email to