[ 
https://issues.apache.org/jira/browse/HIVE-21678?focusedWorklogId=237734&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-237734
 ]

ASF GitHub Bot logged work on HIVE-21678:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 06/May/19 11:49
            Start Date: 06/May/19 11:49
    Worklog Time Spent: 10m 
      Work Description: sankarh commented on 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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 237734)
    Time Spent: 40m  (was: 0.5h)

> CTAS creating a partitioned table fails because of no writeId
> -------------------------------------------------------------
>
>                 Key: HIVE-21678
>                 URL: https://issues.apache.org/jira/browse/HIVE-21678
>             Project: Hive
>          Issue Type: Sub-task
>          Components: HiveServer2, repl
>    Affects Versions: 4.0.0
>            Reporter: Ashutosh Bapat
>            Assignee: Ashutosh Bapat
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-21678.01.patch, HIVE-21678.02.patch
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> create table t1(a int, b int);
> insert into t1 values (1, 2), (3, 4);
> create table t6_part partitioned by (a) stored as orc tblproperties 
> ("transactional"="true") as select * from t1;
> ERROR : FAILED: Execution Error, return code 1 from 
> org.apache.hadoop.hive.ql.exec.MoveTask. MoveTask : Write id is not set in 
> the config by open txn task for migration
> Error: Error while processing statement: FAILED: Execution Error, return code 
> 1 from org.apache.hadoop.hive.ql.exec.MoveTask. MoveTask : Write id is not 
> set in the config by open txn task for migration (state=08S01,code=1)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to