jcamachor commented on a change in pull request #782: HIVE-22209: Graceful
error msg when there is no table for a materiali…
URL: https://github.com/apache/hive/pull/782#discussion_r327752325
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/QB.java
##########
@@ -456,4 +456,22 @@ public boolean containsQueryWithoutSourceTable() {
}
return aliasToTabs.size()==0 && aliasToSubq.size()==0;
}
+
+ // returns false when the query block doesn't have
+ // a table defined, e.g. "select 5"
+ public boolean hasTableDefined() {
+ // A table is not defined when there only exists a dummy
+ // table in the alias, so if it is blank, we know a table
+ // is defined.
+ if (aliasToTabs.size() == 0) {
Review comment:
Can we check when you were getting `null`? It is suspicious... AFAIK, before
calling this method, we iterate through the same structure in L14102 in
SemanticAnalyzer and alias should not be null (btw, this code could be
integrated within this loop to avoid looping twice).
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]