You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/05/02 07:58:00 UTC

[jira] [Work logged] (HIVE-26148) Keep MetaStoreFilterHook interface compatibility after introducing catalogs

     [ https://issues.apache.org/jira/browse/HIVE-26148?focusedWorklogId=764870&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-764870 ]

ASF GitHub Bot logged work on HIVE-26148:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/May/22 07:57
            Start Date: 02/May/22 07:57
    Worklog Time Spent: 10m 
      Work Description: pvary commented on code in PR #3218:
URL: https://github.com/apache/hive/pull/3218#discussion_r862656055


##########
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/PrivilegeSynchronizer.java:
##########
@@ -89,18 +89,21 @@ private void addACLsToBag(
       for (Map.Entry<HiveResourceACLs.Privilege, HiveResourceACLs.AccessResult> acl : principalAcls.getValue()
           .entrySet()) {
         if (acl.getValue() == HiveResourceACLs.AccessResult.ALLOWED) {
+          HiveObjectRef hiveObjectRef = null;
           switch (objectType) {
           case DATABASE:
+            hiveObjectRef = new HiveObjectRef(HiveObjectType.DATABASE, dbName, null, null, null);

Review Comment:
   Shall we set the catalogname to the `HiveObjectRef`?



##########
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/PrivilegeSynchronizer.java:
##########
@@ -89,18 +89,21 @@ private void addACLsToBag(
       for (Map.Entry<HiveResourceACLs.Privilege, HiveResourceACLs.AccessResult> acl : principalAcls.getValue()
           .entrySet()) {
         if (acl.getValue() == HiveResourceACLs.AccessResult.ALLOWED) {
+          HiveObjectRef hiveObjectRef = null;
           switch (objectType) {
           case DATABASE:
+            hiveObjectRef = new HiveObjectRef(HiveObjectType.DATABASE, dbName, null, null, null);
+            hiveObjectRef.setCatName(catName);
             privBag.addToPrivileges(
-                new HiveObjectPrivilege(new HiveObjectRef(HiveObjectType.DATABASE, dbName, null, null, null), principal,
-                    principalType, new PrivilegeGrantInfo(acl.getKey().toString(),
-                        (int) (System.currentTimeMillis() / 1000), GRANTOR, PrincipalType.USER, false), authorizer));
+                new HiveObjectPrivilege(hiveObjectRef, principal, principalType, new PrivilegeGrantInfo(acl.getKey().toString(),

Review Comment:
   Same as above





Issue Time Tracking
-------------------

    Worklog Id:     (was: 764870)
    Time Spent: 2h  (was: 1h 50m)

> Keep MetaStoreFilterHook interface compatibility after introducing catalogs
> ---------------------------------------------------------------------------
>
>                 Key: HIVE-26148
>                 URL: https://issues.apache.org/jira/browse/HIVE-26148
>             Project: Hive
>          Issue Type: Improvement
>          Components: Hive
>    Affects Versions: 3.0.0
>            Reporter: Wechar
>            Assignee: Wechar
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 4.0.0-alpha-1
>
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> Hive 3.0 introduce catalog concept, when we upgrade hive dependency version from 2.3 to 3.x, we found some interfaces of *MetaStoreFilterHook* are not compatible:
> {code:bash}
>  git show ba8a99e115 -- standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreFilterHook.java
> {code}
> {code:bash}
> --- a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreFilterHook.java
> +++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreFilterHook.java
>    /**
>     * Filter given list of tables
> -   * @param dbName
> -   * @param tableList
> +   * @param catName catalog name
> +   * @param dbName database name
> +   * @param tableList list of table returned by the metastore
>     * @return List of filtered table names
>     */
> -  public List<String> filterTableNames(String dbName, List<String> tableList) throws MetaException;
> +  List<String> filterTableNames(String catName, String dbName, List<String> tableList)
> +      throws MetaException;
> {code}
> We can remain the previous interfaces and use the default catalog to implement.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)