You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2019/09/24 03:58:13 UTC

[GitHub] [hive] jcamachor commented on a change in pull request #782: HIVE-22209: Graceful error msg when there is no table for a materiali…

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_r327418079
 
 

 ##########
 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:
   This is a bit counterintuitive... Just to confirm, if `.size() == 0`, then there are table definitions in the query?

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


With regards,
Apache Git Services

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