[
https://issues.apache.org/jira/browse/HIVE-26246?focusedWorklogId=778826&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-778826
]
ASF GitHub Bot logged work on HIVE-26246:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 07/Jun/22 03:58
Start Date: 07/Jun/22 03:58
Worklog Time Spent: 10m
Work Description: 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.
Issue Time Tracking
-------------------
Worklog Id: (was: 778826)
Time Spent: 40m (was: 0.5h)
> Filter out results 'show connectors' on HMS client-side
> ---------------------------------------------------------
>
> Key: HIVE-26246
> URL: https://issues.apache.org/jira/browse/HIVE-26246
> Project: Hive
> Issue Type: Sub-task
> Affects Versions: 4.0.0-alpha-1, 4.0.0-alpha-2
> Reporter: zhangbutao
> Assignee: zhangbutao
> Priority: Major
> Labels: pull-request-available
> Time Spent: 40m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.20.7#820007)