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

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

                Author: ASF GitHub Bot
            Created on: 19/May/21 07:54
            Start Date: 19/May/21 07:54
    Worklog Time Spent: 10m 
      Work Description: marton-bod commented on a change in pull request #2243:
URL: https://github.com/apache/hive/pull/2243#discussion_r634998109



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
##########
@@ -7759,6 +7759,18 @@ protected Operator genFileSinkPlan(String dest, QB qb, 
Operator input)
               .getMsg(destinationPath.toUri().toString()));
         }
       }
+      // handle direct insert CTAS case
+      // for direct insert CTAS, the table creation DDL is not added to the 
task plan in TaskCompiler,
+      // therefore we need to add the InsertHook here manually so that 
HiveMetaHook#commitInsertTable is called
+      if (qb.isCTAS() && tableDesc != null && tableDesc.getStorageHandler() != 
null) {
+        try {
+          if (HiveUtils.getStorageHandler(conf, 
tableDesc.getStorageHandler()).directInsertCTAS()) {
+            createPreInsertDesc(destinationTable, false);
+          }
+        } catch (HiveException e) {

Review comment:
       Right. Now that I think about it, the main reason I swallowed the 
exception is that this is a general hive codepath, so didn't want to screw up 
any normal hive ctas queries. But I think we can assume that even for normal 
hive ctas, if the table has a storage handler defined, it should be loadable. 




-- 
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:
us...@infra.apache.org


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

    Worklog Id:     (was: 599055)
    Time Spent: 3.5h  (was: 3h 20m)

> Implement CTAS for Iceberg
> --------------------------
>
>                 Key: HIVE-25034
>                 URL: https://issues.apache.org/jira/browse/HIVE-25034
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Marton Bod
>            Assignee: Marton Bod
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 3.5h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to