saihemanth-cloudera commented on a change in pull request #2442:
URL: https://github.com/apache/hive/pull/2442#discussion_r705807353
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/TaskCompiler.java
##########
@@ -472,6 +474,28 @@ private void setLoadFileLocation(
loc = cmv.getLocation();
}
Path location = (loc == null) ? getDefaultCtasLocation(pCtx) : new
Path(loc);
+ if (pCtx.getQueryProperties().isCTAS()) {
+ boolean isExternal = pCtx.getCreateTable().isExternal();
+ boolean isAcid = pCtx.getCreateTable().getTblProps().getOrDefault(
+ hive_metastoreConstants.TABLE_IS_TRANSACTIONAL,
"false").equalsIgnoreCase("true") ||
+
pCtx.getCreateTable().getTblProps().containsKey(hive_metastoreConstants.TABLE_TRANSACTIONAL_PROPERTIES);
+ if ((HiveConf.getBoolVar(conf,
HiveConf.ConfVars.CREATE_TABLE_AS_EXTERNAL) || isExternal) && !isAcid) {
Review comment:
Two reasons I don't want to remove this condition.
1) If we can have this condition we can avoid calling the HMS dry run api,
if the tables are managed tables (which is the current behavior).
2) Only HS2 would know if hive.create.as.external.legacy config, so this
condition should be in HS2
3) L#486 is introducing buckerting_version table parameter in the explain
plan for all the tables. Even if I hide it in L#492 this paramter would be
missing in the describe/explain table commands. It is failing few tests.
So I think this should be ok leaving this condition.
--
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]