linliu-code commented on code in PR #14317:
URL: https://github.com/apache/hudi/pull/14317#discussion_r2771074517


##########
hudi-aws/src/main/java/org/apache/hudi/aws/sync/AWSGlueCatalogSyncClient.java:
##########
@@ -517,6 +518,50 @@ public void updateTableSchema(String tableName, 
MessageType newSchema) {
     }
   }
 
+  @Override
+  public void createOrReplaceTable(String tableName,
+                                   MessageType storageSchema,
+                                   String inputFormatClass,
+                                   String outputFormatClass,
+                                   String serdeClass,
+                                   Map<String, String> serdeProperties,
+                                   Map<String, String> tableProperties) {
+
+    if (!tableExists(tableName)) {
+      // if table doesn't exist before, directly create new table.
+      createTable(tableName, storageSchema, inputFormatClass, 
outputFormatClass, serdeClass, serdeProperties, tableProperties);
+      return;
+    }
+
+    try {
+      // Create a temp table will validate the schema before dropping and 
recreating the table
+      String tempTableName = generateTempTableName(tableName);

Review Comment:
   TableInput builder requires parameters like parameters, tableType, etc. 
These parameters are from the Table Object. I think @ad1happy2go was trying to 
reduce the trouble to construct these parameters; of course generate more 
latency. I think it should be good for now.



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