dengzhhu653 commented on code in PR #6573:
URL: https://github.com/apache/hive/pull/6573#discussion_r3602202469
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/handler/GetTableHandler.java:
##########
@@ -335,8 +335,14 @@ private List<Table>
getTableObjectsInternal(GetTablesRequest req)
List<Table> tables = new ArrayList<>();
int tableBatchSize = MetastoreConf.getIntVar(conf,
MetastoreConf.ConfVars.BATCH_RETRIEVE_MAX);
List<String> tableNames = req.getTblNames();
- if(req.getTablesPattern() != null) {
- tables = ms.getTableObjectsByName(catName, dbName, tableNames,
projectionsSpec, req.getTablesPattern());
+ // case : tableNames is empty -> return empty list
+ if (tableNames != null && tableNames.isEmpty()) {
+ return tables;
+ }
+
+ if (req.getTablesPattern() != null && tableNames == null) {
Review Comment:
Adding them both looks unnecessary for me, as we can filter the table names
by the pattern ahead before reaching Metastore, thus saving the check against
the pattern in the database.
@vikramahuja1001 do you know how/when if a user input the two parameters?
--
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]