marton-bod commented on a change in pull request #2243:
URL: https://github.com/apache/hive/pull/2243#discussion_r634493887



##########
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:
       See above. I was thinking of swallowing it because I just wanted to 
proceed with the operation even if the storage handler class is not loadable. 
Do you think we should throw an exception and kill the query in this case?




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to