You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2020/10/15 17:42:29 UTC

[GitHub] [hive] nrg4878 commented on a change in pull request #1578: HIVE-24271: Managed keyword in create table should always create ACID…

nrg4878 commented on a change in pull request #1578:
URL: https://github.com/apache/hive/pull/1578#discussion_r505724698



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
##########
@@ -13194,16 +13194,16 @@ private void updateDefaultTblProps(Map<String, String> source, Map<String, Strin
       }
     }
 
-    boolean makeInsertOnly = !isTemporaryTable && (isManaged && HiveConf.getBoolVar(
-        conf, ConfVars.HIVE_CREATE_TABLES_AS_INSERT_ONLY));
-    boolean makeAcid = !isTemporaryTable && !makeInsertOnly && makeAcid();
+    boolean makeInsertOnly = !isTemporaryTable && HiveConf.getBoolVar(
+        conf, ConfVars.HIVE_CREATE_TABLES_AS_INSERT_ONLY);
+    boolean makeAcid = !isTemporaryTable && makeAcid();
     // if not specify managed table and create.table.as.external is true
     // ignore makeInsertOnly and makeAcid.
     if (!isManaged && HiveConf.getBoolVar(conf, ConfVars.CREATE_TABLE_AS_EXTERNAL)) {
       makeInsertOnly = false;
       makeAcid = false;
     }
-    if ((makeInsertOnly || makeAcid || isTransactional)
+    if ((makeInsertOnly || makeAcid || isTransactional || isManaged)
         && !isExt  && !isMaterialization && StringUtils.isBlank(storageFormat.getStorageHandler())

Review comment:
       multiple ways to create acid table
   create transactional table
   create managed table
   create table with hive.create.as.acid=true or hive.create.as.insert.only=true.
   
   so the above logic ensures that table is ACID table when managed keyword if used.




----------------------------------------------------------------
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org