vinishjail97 commented on code in PR #940:
URL: https://github.com/apache/incubator-xtable/pull/940#discussion_r4010246403


##########
xtable-aws/src/main/java/org/apache/xtable/glue/table/DeltaGlueCatalogTableBuilder.java:
##########
@@ -90,13 +101,25 @@ public TableInput getUpdateTableRequest(
         .tableType(GLUE_EXTERNAL_TABLE_TYPE)
         .parameters(parameters)
         .storageDescriptor(
-            catalogTable.storageDescriptor().toBuilder()
-                .columns(schemaExtractor.getNonPartitionColumns(table, 
columnsMap))
-                .build())
+            getStorageDescriptor(table, 
schemaExtractor.getNonPartitionColumns(table, columnsMap)))

Review Comment:
   Could we update the existing descriptor with `toBuilder()`? Rebuilding it 
removes existing storage parameters, `additionalLocations`, and custom SerDe 
settings during refresh. For example:
   
   ```java
   StorageDescriptor existing = catalogTable.storageDescriptor();
   SerDeInfo.Builder serde =
       existing.serdeInfo() == null
           ? SerDeInfo.builder().parameters(getSerDeParameters(table))
           : existing.serdeInfo().toBuilder();
   
   StorageDescriptor updated =
       existing.toBuilder()
           .columns(schemaExtractor.getNonPartitionColumns(table, columnsMap))
           .inputFormat(PARQUET_INPUT_FORMAT)
           .outputFormat(PARQUET_OUTPUT_FORMAT)
           .serdeInfo(serde.serializationLibrary(PARQUET_SERDE_CLASS).build())
           .build();
   ```
   
   Then use `.storageDescriptor(updated)` in the update request. This preserves 
existing settings while adding the required Parquet formats.



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