jerryshao commented on code in PR #4942:
URL: https://github.com/apache/gravitino/pull/4942#discussion_r1769508444
##########
catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/backend/hms/HudiHMSTable.java:
##########
@@ -44,15 +49,24 @@ protected HudiHMSTable simpleBuild() {
table.columns = columns;
table.indexes = indexes;
table.partitioning = partitioning;
+ table.sortOrders = sortOrders;
table.distribution = distribution;
table.properties = properties;
table.auditInfo = auditInfo;
return table;
}
@Override
- protected HudiTable buildFromTable(Table backendTable) {
- // todo: convert HMS table to HudiTable
+ protected HudiHMSTable buildFromTable(Table hmsTable) {
+ name = hmsTable.getTableName();
+ comment = hmsTable.getParameters().get(COMMENT);
+ columns = HiveTableConverter.getColumns(hmsTable, HudiColumn.builder());
+ partitioning = HiveTableConverter.getPartitioning(hmsTable);
+ sortOrders = HiveTableConverter.getSortOrders(hmsTable);
+ distribution = HiveTableConverter.getDistribution(hmsTable);
Review Comment:
Does Hudi store such information in HMS, is it compatible with Hive table?
As I know, for Iceberg, we need some Iceberg APIs to get partitioning,
sortOrders, because Iceberg will store such information in it's metadata file,
not in HMS, I guess Hudi is similar, can you please confirm this?
--
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]