SourabhBadhya commented on code in PR #3281:
URL: https://github.com/apache/hive/pull/3281#discussion_r887625106
##########
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:
Updated.
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java:
##########
@@ -8229,9 +8299,17 @@ private void handleLineage(LoadTableDesc ltd, Operator
output)
Path tlocation = null;
String tName = Utilities.getDbTableName(tableDesc.getDbTableName())[1];
try {
+ String suffix = "";
+ if (AcidUtils.isTransactionalTable(destinationTable)) {
Review Comment:
Updated.
--
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]