lokeshj1703 commented on code in PR #14317:
URL: https://github.com/apache/hudi/pull/14317#discussion_r2742688335


##########
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:
   Can we avoid creating the temporary table?



##########
hudi-common/src/test/java/org/apache/hudi/common/testutils/SchemaTestUtil.java:
##########
@@ -78,10 +78,18 @@ public static Schema getSimpleSchema() throws IOException {
     return new 
Schema.Parser().parse(SchemaTestUtil.class.getResourceAsStream("/simple-test.avsc"));
   }
 
+  public static Schema getSchema(String path) throws IOException {

Review Comment:
   Seems like the APIs introduced in this class are not used. Can you please 
check?



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