Uploaded image for project: 'Sentry (Retired)'
  1. Sentry (Retired)
  2. SENTRY-1465

truncate table is not working with qualified table names from beeline

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.5.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Steps to reproduce the issue:

      0: jdbc:hive2://...> create table temp.a (b int);
      ...
      INFO  : OK
      No rows affected (0.163 seconds)
      
      0: jdbc:hive2://...> truncate table temp.a;
      Error: Error while compiling statement: FAILED: SemanticException No valid privileges
       User admin does not have privileges for TRUNCATETABLE
       The required privileges: Server=server1->Db=default->Table=temp->action=*; (state=42000,code=40000)
      

      The user has no privileges in the default database:

      0: jdbc:hive2://...> show current roles;
      
      +---------------+--+
      |     role      |
      +---------------+--+
      | analyst_role  |
      +---------------+--+
      
      0: jdbc:hive2://...> show grant role analyst_role;
      
      +-----------+--------+------------+---------+-----------------+-----------------+------------+---------------+-------------------+----------+--+
      | database  | table  | partition  | column  | principal_name  | principal_type  | privilege  | grant_option  |    grant_time     | grantor  |
      +-----------+--------+------------+---------+-----------------+-----------------+------------+---------------+-------------------+----------+--+
      | temp      |        |            |         | analyst_role    | ROLE            | *          | false         | 1473206055358000  | --       |
      +-----------+--------+------------+---------+-----------------+-----------------+------------+---------------+-------------------+----------+--+
      

      A workaround is to add default database privileges to the user

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                morhidi Matyas Orhidi
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: