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

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

                Author: ASF GitHub Bot
            Created on: 08/May/19 05:43
            Start Date: 08/May/19 05:43
    Worklog Time Spent: 10m 
      Work Description: ashutosh-bapat commented on pull request #614: 
HIVE-21678
URL: https://github.com/apache/hive/pull/614#discussion_r281919915
 
 

 ##########
 File path: ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
 ##########
 @@ -7477,18 +7477,30 @@ protected Operator genFileSinkPlan(String dest, QB qb, 
Operator input)
         fileSinkColInfos = new ArrayList<>();
         destTableIsTemporary = tblDesc.isTemporary();
         destTableIsMaterialization = tblDesc.isMaterialization();
-        if (AcidUtils.isInsertOnlyTable(tblDesc.getTblProps(), true)) {
-          isMmTable = isMmCtas = true;
+        if (AcidUtils.isTablePropertyTransactional(tblDesc.getTblProps())) {
           try {
             if (ctx.getExplainConfig() != null) {
               writeId = 0L; // For explain plan, txn won't be opened and 
doesn't make sense to allocate write id
             } else {
-              writeId = txnMgr.getTableWriteId(tblDesc.getDatabaseName(), 
tblDesc.getTableName());
+              String dbName = tblDesc.getDatabaseName();
+              String tableName = tblDesc.getTableName();
+
+              // CreateTableDesc stores table name as db.table. So, need to 
decode it before allocating
+              // write id.
+              if ((dbName == null) || tableName.contains(".")) {
 
 Review comment:
   Done as part of rebase.
 
----------------------------------------------------------------
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: 239012)
    Time Spent: 2h 10m  (was: 2h)

> 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, 
> HIVE-21678.03.patch, HIVE-21678.04.patch
>
>          Time Spent: 2h 10m
>  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