zhangbutao commented on code in PR #4341:
URL: https://github.com/apache/hive/pull/4341#discussion_r1269113129


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:
##########
@@ -2256,9 +2258,19 @@ private void create_table_core(final RawStore ms, final 
CreateTableRequest req)
       tbl = transformer.transformCreateTable(tbl, processorCapabilities, 
processorId);
     }
 
-    if (tbl.getParameters() != null) {
-      tbl.getParameters().remove(TABLE_IS_CTAS);
-      tbl.getParameters().remove(TABLE_IS_CTLT);
+    Map<String, String> params = tbl.getParameters();
+    if (params != null) {
+      params.remove(TABLE_IS_CTAS);
+      params.remove(TABLE_IS_CTLT);
+      String txnal = params.get(TABLE_IS_TRANSACTIONAL);
+      boolean create_always_as_external = 
params.containsKey(CTAS_LEGACY_CONFIG) && params.get(CTAS_LEGACY_CONFIG)
+          .equalsIgnoreCase("true") ? true : false;
+      if (create_always_as_external && (txnal == null || 
txnal.equalsIgnoreCase("FALSE"))

Review Comment:
   Refer to this code snippet:
   
https://github.com/apache/hive/blob/8ea1d78d0dc18fec4305dd0d0a9e341ecdcaef1e/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetastoreDefaultTransformer.java#L649-L650



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to