abstractdog commented on code in PR #5613:
URL: https://github.com/apache/hive/pull/5613#discussion_r1941505378


##########
ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java:
##########
@@ -2092,4 +2105,24 @@ protected String getFullTableNameForSQL(ASTNode n) 
throws SemanticException {
     }
   }
 
+  /**
+   * Handles all the magic to resolve the queryType that hasn't already been 
taken care of by subclasses or different
+   * code paths in the semantic analyzers (and corresponding factories), so 
this method is typically called at the end
+   * of the analysis process, where all the analysis context is present as 
well as the AST.
+   * @param tree the root ASTNode of the query
+   */
+  protected void setQueryType(ASTNode tree) {
+    if (queryProperties.getQueryType() != null) {
+      return; //already figured out
+    }
+    // in case of a semantic exception (e.g. a table not found or something 
else)
+    // the root AST Node can still imply if this is a query, try to fall back 
to that
+    // instead of ""
+    String text = tree.getText();

Review Comment:
   yeah, finally it was just used once



-- 
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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to