sankarh commented on a change in pull request #614: HIVE-21678
URL: https://github.com/apache/hive/pull/614#discussion_r281152390
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java
##########
@@ -398,11 +398,20 @@ public int execute(DriverContext driverContext) {
// for transactional table if write id is not set during replication
from a cluster with STRICT_MANAGED set
// to false then set it now.
if (tbd.getWriteId() <= 0 &&
AcidUtils.isTransactionalTable(table.getParameters())) {
- Long writeId = ReplUtils.getMigrationCurrentTblWriteId(conf);
- if (writeId == null) {
- throw new HiveException("MoveTask : Write id is not set in the
config by open txn task for migration");
+ if (work.getIsInReplicationScope()) {
+ Long writeId = ReplUtils.getMigrationCurrentTblWriteId(conf);
+ if (writeId == null) {
+ throw new HiveException("MoveTask : Write id is not set in the
config by open txn task for migration");
+ }
+ tbd.setWriteId(writeId);
+ } else if (tbd.isCtas()) {
Review comment:
Need not pass isCtas flag. Instead
driverContext.getCtx().getHiveTxnManager().getAllocatedTableWriteId can be
called and if it returns 0, then throw error.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]