henrib commented on code in PR #4601: URL: https://github.com/apache/hive/pull/4601#discussion_r1297355025
########## ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HivePrivilegeObjectUtils.java: ########## @@ -59,7 +59,74 @@ public static List<HivePrivilegeObject> getHivePrivDcObjects(List<String> dcList objs.add(new HivePrivilegeObject(HivePrivilegeObjectType.DATACONNECTOR, null, dcname)); } return objs; + } + + + /** + * An index on a table list by dbName, tableName. + */ + public abstract static class TableIndex<T> { + private final T[] index; + protected abstract String getDbName(T item); + protected abstract String getTableName(T item); + protected TableIndex(List<T> tables) { + if (tables != null) { + index = tables.toArray((T[]) new Object[0]); + // sort them by dbname, tblname + Arrays.sort(index, (left, right)->{ + int cmp = getDbName(left).compareTo(getDbName(right)); Review Comment: Created helper functions, refactored that part. -- 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: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org