ashutosh-bapat commented on a change in pull request #614: HIVE-21678
URL: https://github.com/apache/hive/pull/614#discussion_r281596675
 
 

 ##########
 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:
   WriteId for the table being created is obtained while creating loadTableDesc 
itself. So requested change is not required.

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

Reply via email to