saihemanth-cloudera commented on code in PR #3304:
URL: https://github.com/apache/hive/pull/3304#discussion_r890400667
##########
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/AuthorizationMetaStoreFilterHook.java:
##########
@@ -49,7 +49,7 @@ public AuthorizationMetaStoreFilterHook(Configuration conf) {
public List<String> filterTableNames(String catName, String dbName,
List<String> tableList)
throws MetaException {
List<HivePrivilegeObject> listObjs = getHivePrivObjects(dbName, tableList);
- return getTableNames(getFilteredObjects(listObjs));
+ return getObjectNames(getFilteredObjects(listObjs));
Review Comment:
Does name of the method: getFilteredObjectNames() makes more sense?
##########
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HivePrivilegeObjectUtils.java:
##########
@@ -48,4 +48,18 @@ public static List<HivePrivilegeObject>
getHivePrivDbObjects(List<String> dbList
}
+ /**
+ * Convert list of dcnames into list of HivePrivilegeObject
+ * @param dcList
+ * @return
+ */
+ public static List<HivePrivilegeObject> getHivePrivDcObjects(List<String>
dcList) {
+ List<HivePrivilegeObject> objs = new ArrayList<HivePrivilegeObject>();
+ for (String dcname : dcList) {
+ objs.add(new HivePrivilegeObject(HivePrivilegeObjectType.DATACONNECTOR,
dcname, dcname));
Review Comment:
I think it is ideal to pass HivePrivilegeObjectType.DATACONNECTOR, null,
dcname as arguments to HivePrivilegeObject since one of the constructors for
HivePrivilegeObject class is HivePrivilegeObjectType, database name, object
name.
##########
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestFilterHooks.java:
##########
@@ -210,6 +225,12 @@ protected void creatEnv(Configuration conf) throws
Exception {
client.dropDatabase(DBNAME1, true, true, true);
client.dropDatabase(DBNAME2, true, true, true);
+ try {
+ client.dropDataConnector(DCNAME1, true, true);
+ client.dropDataConnector(DCNAME2, true, true);
+ } catch (NoSuchObjectException e) {
+ // no op
Review Comment:
I'm wondering why we are doing a no-op for this drop operation since we are
already passing true as value for ifnotexists argument.
So, I don't think we need to catch nosuchobjectexception.
--
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]