nrg4878 commented on a change in pull request #1970:
URL: https://github.com/apache/hive/pull/1970#discussion_r597840626
##########
File path:
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
##########
@@ -1854,13 +1854,21 @@ private MTable getMTable(String catName, String db,
String table) {
catName = normalizeIdentifier(catName);
List<String> lowered_tbl_names = new ArrayList<>(tbl_names.size());
- for (String t : tbl_names) {
- lowered_tbl_names.add(normalizeIdentifier(t));
+ if(tbl_names != null) {
+ for (String t : tbl_names) {
+ lowered_tbl_names.add(normalizeIdentifier(t));
+ }
}
query = pm.newQuery(MTable.class);
- query.setFilter("database.name == db && database.catalogName == cat &&
tbl_names.contains(tableName)");
- query.declareParameters("java.lang.String db, java.lang.String cat,
java.util.Collection tbl_names");
+
+ if(tablePattern == null) {
Review comment:
So this is a bit confusing as we discussed. A cleaner and less confusing
approach will be to honor both the tbl_names and tablePattern. So you will have
3 scenarios
1) tbl_names not empty but tablePattern is null: Old behavior that will
fetch just the objects for the tables provided.
2) tbl_names is empty but tablePattern is not null: The behavior you are
attempting to introduce where HMS will fetch all table object for names
matching the tablePattern.
3) tbl_names not empty and tablePattern not null: There is no usage scenario
in the hive code base currently but this will return table objects for only
those tables in the tbl_names whose names match the tablePattern. Others names
in the list will be omitted.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]