[ 
https://issues.apache.org/jira/browse/HIVE-25670?focusedWorklogId=678955&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-678955
 ]

ASF GitHub Bot logged work on HIVE-25670:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 09/Nov/21 09:21
            Start Date: 09/Nov/21 09:21
    Worklog Time Spent: 10m 
      Work Description: kgyrtkirk commented on a change in pull request #2763:
URL: https://github.com/apache/hive/pull/2763#discussion_r745425625



##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/RelOptHiveTable.java
##########
@@ -333,12 +360,20 @@ public boolean isKey(ImmutableBitSet columns) {
           parentTableQualifiedName.add(parentTableName);
           qualifiedName = parentTableName;
         }
+        if (!tablesCache.containsKey(qualifiedName)) {
+          // Table doesn't exist in the cache, so we don't need to track
+          // these referential constraints. But we do need to keep track
+          // of the table in case the tableCache gets populated later, though
+          // in theory, this should never happen based on how this is called.

Review comment:
       Trying to expect the unexpected is very hard to do :)
   Can't we roll some rules/conventions/etc and/or throw exception if that 
happens instead of trying to cover a case we don't even know will happen?
   It could probably make things more straight as well




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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 678955)
    Time Spent: 40m  (was: 0.5h)

> Avoid getTable() calls for foreign key tables not used in a query
> -----------------------------------------------------------------
>
>                 Key: HIVE-25670
>                 URL: https://issues.apache.org/jira/browse/HIVE-25670
>             Project: Hive
>          Issue Type: Improvement
>          Components: HiveServer2
>            Reporter: Steve Carlin
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> In RelOptHiveTable, we generate the referential constraints for the table. In 
> this process, we make a metastore call to fetch these tables.  This is used 
> later on for potential gain on joins done on the key.
> However, there is no need to fetch these constraints if the table is not used 
> in the query. If we can get this information up front, we can save a bit on 
> compilation time.
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to