mchades commented on code in PR #4928:
URL: https://github.com/apache/gravitino/pull/4928#discussion_r1759644129
##########
catalogs/catalog-hive/src/main/java/org/apache/gravitino/catalog/hive/HiveTable.java:
##########
@@ -76,55 +72,15 @@ private HiveTable() {}
* @return A new HiveTable instance Builder.
*/
public static HiveTable.Builder fromHiveTable(Table table) {
- // Get audit info from Hive's Table object. Because Hive's table doesn't
store last modifier
- // and last modified time, we only get creator and create time from Hive's
table.
- AuditInfo.Builder auditInfoBuilder = AuditInfo.builder();
-
Optional.ofNullable(table.getOwner()).ifPresent(auditInfoBuilder::withCreator);
- if (table.isSetCreateTime()) {
-
auditInfoBuilder.withCreateTime(Instant.ofEpochSecond(table.getCreateTime()));
- }
+ AuditInfo auditInfo = ConvertUtil.getAuditInfo(table);
- StorageDescriptor sd = table.getSd();
- Distribution distribution = Distributions.NONE;
- if (sd.getBucketCols() != null && !sd.getBucketCols().isEmpty()) {
- // Hive table use hash strategy as bucketing strategy
- distribution =
- Distributions.hash(
- sd.getNumBuckets(),
-
sd.getBucketCols().stream().map(NamedReference::field).toArray(Expression[]::new));
- }
+ Distribution distribution = ConvertUtil.getDistribution(table);
Review Comment:
renamed to `HiveTableConverter`
--
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]