ayushtkn commented on code in PR #4549:
URL: https://github.com/apache/hive/pull/4549#discussion_r1284093401


##########
ql/src/java/org/apache/hadoop/hive/ql/HiveQueryLifeTimeHook.java:
##########
@@ -75,13 +75,15 @@ private void checkAndRollbackCTAS(QueryLifeTimeHookContext 
ctx) {
     PrivateHookContext pCtx = (PrivateHookContext) ctx.getHookContext();
     Path tblPath = pCtx.getContext().getLocation();
 
-    try {
-      FileSystem fs = tblPath.getFileSystem(conf);
-      if (!fs.exists(tblPath)) {
-        return;
+    if (tblPath != null) {
+      try {
+        FileSystem fs = tblPath.getFileSystem(conf);
+        if (!fs.exists(tblPath)) {
+          return;
+        }
+      } catch (Exception e) {
+        throw new RuntimeException("Not able to check whether the CTAS table 
directory exists due to: ", e);

Review Comment:
   The method calling is ```private void 
checkAndRollbackCTAS(QueryLifeTimeHookContext ctx) {``` and you mean to say 
this method gets invoked for non CTAS queries as well? If so just remove CTAS 
from the exception message



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

To unsubscribe, e-mail: [email protected]

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