[GitHub] [hudi] xushiyan commented on a diff in pull request #5920: [HUDI-4326] add updateTableSerDeInfo for HiveSyncTool

2022-09-19 Thread GitBox


xushiyan commented on code in PR #5920:
URL: https://github.com/apache/hudi/pull/5920#discussion_r974895469


##
hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/HiveSyncTool.java:
##
@@ -290,6 +290,9 @@ private boolean syncSchema(String tableName, boolean 
tableExists, boolean useRea
 // Sync the table properties if the schema has changed
 if (config.getString(HIVE_TABLE_PROPERTIES) != null || 
config.getBoolean(HIVE_SYNC_AS_DATA_SOURCE_TABLE)) {
   syncClient.updateTableProperties(tableName, tableProperties);
+  HoodieFileFormat baseFileFormat = 
HoodieFileFormat.valueOf(config.getStringOrDefault(META_SYNC_BASE_FILE_FORMAT).toUpperCase());
+  String serDeFormatClassName = 
HoodieInputFormatUtils.getSerDeClassName(baseFileFormat);
+  syncClient.updateTableSerDeInfo(tableName, serDeFormatClassName, 
serdeProperties);

Review Comment:
   we don't need to pass serde class from the API. it's controlled by the base 
file format, which is taken from the sync 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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [hudi] xushiyan commented on a diff in pull request #5920: [HUDI-4326] add updateTableSerDeInfo for HiveSyncTool

2022-09-19 Thread GitBox


xushiyan commented on code in PR #5920:
URL: https://github.com/apache/hudi/pull/5920#discussion_r974843935


##
hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/HoodieHiveSyncClient.java:
##
@@ -316,4 +353,11 @@ public void updateTableComments(String tableName, 
List fromMetastor
 }
   }
 
+  Table getTable(String tableName) {
+try {
+  return client.getTable(databaseName, tableName);
+} catch (TException e) {
+  throw new HoodieHiveSyncException(String.format("Database: %s, Table: %s 
 does not exist", databaseName, tableName), e);
+}
+  }

Review Comment:
   where do we use this method? other methods from this class just call 
client.getTable(). we should not introduce random helpers that lowers the code 
quality



-- 
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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org