the-other-tim-brown commented on code in PR #973:
URL: https://github.com/apache/incubator-xtable/pull/973#discussion_r4433612755
##########
xtable-core/src/test/java/org/apache/xtable/kernel/TestDeltaKernelSchemaExtractor.java:
##########
@@ -412,6 +412,30 @@ public void testNestedFieldIdsInDeltaSchema() {
"_one_field_element"));
}
+ @Test
+ public void testColumnMappingPhysicalNamePropagatedAsStorageName() {
+ // Regression for #977: with column mapping enabled, a column renamed
after files were
+ // written must keep its pre-rename physical name as storageName, so that
the Iceberg name
+ // mapping can resolve files written before the rename. Without the fix,
storageName is
+ // null and pre-rename files read NULL for the renamed column.
+ FieldMetadata renamedMetadata =
+ FieldMetadata.builder()
+ .putLong("delta.columnMapping.id", 3)
+ .putString("delta.columnMapping.physicalName", "name")
+ .build();
+ io.delta.kernel.types.StructType structRepresentation =
Review Comment:
This class should already be imported, it doesn't need the full path
##########
xtable-core/src/test/java/org/apache/xtable/ITConversionController.java:
##########
@@ -1005,6 +1009,79 @@ public void testColumnMappingEnabledDeltaToIceberg() {
}
}
+ @Test
+ public void testLateColumnMappingRenameDeltaToIcebergWithKernelSource() {
+ DeltaKernelConversionSourceProvider conversionSourceProvider =
+ new DeltaKernelConversionSourceProvider();
+ conversionSourceProvider.init(jsc.hadoopConfiguration());
+ testLateColumnMappingRenameDeltaToIceberg(conversionSourceProvider);
+ }
+
+ @Test
+ public void testLateColumnMappingRenameDeltaToIcebergWithStandaloneSource() {
+
testLateColumnMappingRenameDeltaToIceberg(getConversionSourceProvider(DELTA));
Review Comment:
We should be able to make these into a parameterized test?
--
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]