From acc40625f594576353919323c2b34c43309f18d5 Mon Sep 17 00:00:00 2001 From: xiarixiaoyao Date: Wed, 3 Nov 2021 20:36:01 +0800 Subject: [PATCH] [HUDI-2676] Hudi should synchronize owner information to hudi _rt/_ro table. (#3911) --- .../src/main/java/org/apache/hudi/hive/ddl/HMSDDLExecutor.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/ddl/HMSDDLExecutor.java b/hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/ddl/HMSDDLExecutor.java index b31c62ec5acb..37aa54abd33b 100644 --- a/hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/ddl/HMSDDLExecutor.java +++ b/hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/ddl/HMSDDLExecutor.java @@ -18,6 +18,7 @@ package org.apache.hudi.hive.ddl; +import org.apache.hadoop.security.UserGroupInformation; import org.apache.hudi.common.fs.FSUtils; import org.apache.hudi.common.fs.StorageSchemes; import org.apache.hudi.hive.HiveSyncConfig; @@ -101,6 +102,7 @@ public void createTable(String tableName, MessageType storageSchema, String inpu Table newTb = new Table(); newTb.setDbName(syncConfig.databaseName); newTb.setTableName(tableName); + newTb.setOwner(UserGroupInformation.getCurrentUser().getShortUserName()); newTb.setCreateTime((int) System.currentTimeMillis()); StorageDescriptor storageDescriptor = new StorageDescriptor(); storageDescriptor.setCols(fieldSchema);