Uploaded image for project: 'Sentry'
  1. Sentry
  2. SENTRY-826

TRUNCATE on empty partitioned table in Hive fails

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.0
    • Fix Version/s: 1.7.0
    • Component/s: Hive Plugin
    • Labels:
      None

      Description

      TRUNCATE on empty partitioned table in Hive fails. If the table contains at least one partition, the operation will succeed:

      CREATE ROLE admin;
      GRANT ALL ON SERVER server1 TO ROLE admin;
      GRANT ROLE ADMIN TO GROUP <current group>;
      
      CREATE TABLE Foo(i int) PARTITIONED BY (j int);
      -- Fails
      TRUNCATE TABLE Foo;
      
      Error: Error while compiling statement: FAILED: SemanticException No valid privileges
       Required privileges for this query: (state=42000,code=40000)
      
      -- Now add a partition
      ALTER TABLE FOO ADD PARTITION (j=1);
      
      -- Succeeds
      TRUNCATE TABLE Foo;
      

        Attachments

        1. SENTRY-826.1.patch
          11 kB
          Li Li
        2. SENTRY-826.2.patch
          11 kB
          Li Li
        3. SENTRY-826.3.patch
          10 kB
          Li Li

          Issue Links

            Activity

              People

              • Assignee:
                lili Li Li
                Reporter:
                lskuff Lenni Kuff
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: