Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-25077

Direct SQL to fetch column privileges in refreshPrivileges may be broken in postgres

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • None
    • None

    Description

      HIVE-22512 tried to fix direct-sql for col privileges.

       

      However, "GRANT_OPTION" field in "TBL_COL_PRIVS" is marked as smallint in postgres. In code, it is retrieved as boolean.

      Ref: https://github.com/apache/hive/blob/master/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java#L1533

       

              boolean grantOption = MetastoreDirectSqlUtils.extractSqlBoolean(privLine[grantOptionIndex]);
      

       

      https://github.com/apache/hive/blob/048336bd0c21163920557a60c88135b1d5b42d3d/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetastoreDirectSqlUtils.java#L530

       

      MetastoreDirectSqlUtils::extractSqlBoolean should handle integers to support directSQL in postgres.

      Attachments

        Issue Links

          Activity

            People

              VenuReddy Venugopal Reddy K
              rajesh.balamohan Rajesh Balamohan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: