jalpan-randeri commented on code in PR #630:
URL: https://github.com/apache/incubator-xtable/pull/630#discussion_r1966666758


##########
xtable-core/src/main/java/org/apache/xtable/iceberg/IcebergConversionSource.java:
##########
@@ -120,10 +120,18 @@ public InternalTable getTable(Snapshot snapshot) {
         irPartitionFields.size() > 0
             ? DataLayoutStrategy.HIVE_STYLE_PARTITION
             : DataLayoutStrategy.FLAT;
+    // When the table name is not explicitly specified, Iceberg assumes the 
table is HDFS-based,
+    // treating the table name as the location in HDFS. This assumption can 
lead to mismatches
+    // during metadata conversion. To mitigate this issue, we rely on the 
table name provided in the
+    // source configuration of the conversation so target matches the user's 
expectations.
+    // See https://github.com/apache/incubator-xtable/issues/494
     return InternalTable.builder()
         .tableFormat(TableFormat.ICEBERG)
         .basePath(iceTable.location())
-        .name(iceTable.name())
+        .name(
+            iceTable.name().contains(iceTable.location())
+                ? sourceTableConfig.getName()
+                : iceTable.name())

Review Comment:
   Added new test with catalog-config



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