deniskuzZ commented on code in PR #3281:
URL: https://github.com/apache/hive/pull/3281#discussion_r885487387
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/TaskCompiler.java:
##########
@@ -517,17 +517,21 @@ private Path getDefaultCtasLocation(final ParseContext
pCtx) throws SemanticExce
try {
String protoName = null, suffix = "";
boolean isExternal = false;
-
+ boolean useSuffix = HiveConf.getBoolVar(conf,
HiveConf.ConfVars.HIVE_ACID_CREATE_TABLE_USE_SUFFIX)
+ || HiveConf.getBoolVar(conf,
HiveConf.ConfVars.HIVE_ACID_LOCKLESS_READS_ENABLED);
+
if (pCtx.getQueryProperties().isCTAS()) {
protoName = pCtx.getCreateTable().getDbTableName();
isExternal = pCtx.getCreateTable().isExternal();
-
+ if (!isExternal && useSuffix) {
+ long txnId = Optional.ofNullable(pCtx.getContext())
+ .map(ctx ->
ctx.getHiveTxnManager().getCurrentTxnId()).orElse(0L);
+ suffix = SOFT_DELETE_PATH_SUFFIX + String.format(DELTA_DIGITS,
txnId);
Review Comment:
shouldn't be populating suffix if txnId=0
--
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]