morningman commented on code in PR #32458:
URL: https://github.com/apache/doris/pull/32458#discussion_r1530677809


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HiveMetadataOps.java:
##########
@@ -124,16 +134,45 @@ public void createTable(CreateTableStmt stmt) throws 
UserException {
             throw new UserException("Failed to get database: '" + dbName + "' 
in catalog: " + catalog.getName());
         }
         try {
-            Map<String, String> props = stmt.getExtProperties();
-            String fileFormat = props.getOrDefault("file_format", 
Config.hive_default_file_format);
-            HiveTableMetadata catalogTable = HiveTableMetadata.of(dbName,
-                    tblName,
-                    stmt.getColumns(),
-                    parsePartitionKeys(props),
-                    props,
-                    fileFormat);
-
-            client.createTable(catalogTable, stmt.isSetIfNotExists());
+            Map<String, String> props = stmt.getProperties();
+            String fileFormat = props.getOrDefault(FILE_FORMAT_KEY, 
Config.hive_default_file_format);
+            Map<String, String> ddlProps = new HashMap<>();
+            for (Map.Entry<String, String> entry : props.entrySet()) {
+                String key = entry.getKey().toLowerCase();
+                if (DORIS_HIVE_KEYS.contains(entry.getKey().toLowerCase())) {
+                    ddlProps.put("doris." + key, entry.getValue());
+                } else {
+                    ddlProps.put(key, entry.getValue());
+                }
+            }
+            List<String> partitionColNames = new ArrayList<>();
+            if (stmt.getPartitionDesc() != null) {
+                
partitionColNames.addAll(stmt.getPartitionDesc().getPartitionColNames());
+            }
+            HiveTableMetadata hiveTableMeta;
+            DistributionDesc bucketInfo = stmt.getDistributionDesc();
+            if (bucketInfo != null && Config.enable_external_hive_bucket) {

Review Comment:
   This if else is wrong, if Config.enable_external_hive_bucket is false and 
bucketInfo != null, should throw exception



##########
fe/fe-common/src/main/java/org/apache/doris/common/Config.java:
##########
@@ -2216,6 +2216,11 @@ public class Config extends ConfigBase {
             "Enable external table DDL"})
     public static boolean enable_external_ddl = false;
 
+    @ConfField(mutable = true, masterOnly = true, description = {
+            "启用Hive分桶表",
+            "Enable external hive bucket table"})
+    public static boolean enable_external_hive_bucket = false;

Review Comment:
   ```suggestion
       public static boolean enable_create_hive_bucket_table = false;
   ```



-- 
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...@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to