deniskuzZ commented on code in PR #6966:
URL: https://github.com/apache/hive/pull/6966#discussion_r4644245992


##########
ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMetaStoreClientWithLocalCache.java:
##########
@@ -441,14 +526,61 @@ public GetPartitionsByNamesResult 
getPartitionsByNames(GetPartitionsByNamesReque
     return delegate.getPartitionsByNames(req);
   }
 
+  /**
+   * The watermark of a table: by its write ids if it has them, else by its 
version if the query may use those.
+   */
+  private TableWatermark watermark(String validWriteIdList, String catName, 
String dbName, String tblName)

Review Comment:
   With no write-id list and no version cache for the query 
(`hive.metadata.cache.nontransactional.mode=off`, the default), this watermark 
can never be valid, but it still fetches the table first. Outside compilation, 
or with the query-level cache off, that's a metastore call per partition or 
statistics lookup of every non-transactional table. Could it return before the 
fetch?        
   ````                       
   if (validWriteIdList == null && getQuerySettings() == null) {                
                                                                                
                                                
     return new TableWatermark(null, -1);  // no write ids and no versions: 
never valid                                                                     
                                                    
   }   
   ````                                                                         
                                                                                
                                                
   A unit test that counts the delegate's getTable calls for a 
non-transactional table with the mode off would keep it that way.      



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