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

Alter table rename fails when we enable data objects and privileges syncing via hive meta store

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.0
    • Fix Version/s: 1.3.0
    • Component/s: None
    • Labels:
      None

      Description

      alter table tb1 rename to tb2;
      Error: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Unable to alter table. (state=08S01,code=1)
      
      

      Here is the HS2 log snippet:

      org.apache.hadoop.hive.ql.metadata.HiveException: Unable to alter table.
      	at org.apache.hadoop.hive.ql.metadata.Hive.alterTable(Hive.java:390)
      	at org.apache.hadoop.hive.ql.exec.DDLTask.alterTable(DDLTask.java:3212)
      	at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:282)
      	at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:151)
      	at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:65)
      	at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1485)
      	at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1263)
      	at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1091)
      	at org.apache.hadoop.hive.ql.Driver.run(Driver.java:931)
      	at org.apache.hadoop.hive.ql.Driver.run(Driver.java:926)
      	at org.apache.hive.service.cli.operation.SQLOperation.runInternal(SQLOperation.java:144)
      	at org.apache.hive.service.cli.operation.SQLOperation.run(SQLOperation.java:165)
      	at org.apache.hive.service.cli.session.HiveSessionImpl.runOperationWithLogCapture(HiveSessionImpl.java:514)
      	at org.apache.hive.service.cli.session.HiveSessionImpl.executeStatementInternal(HiveSessionImpl.java:222)
      	at org.apache.hive.service.cli.session.HiveSessionImpl.executeStatement(HiveSessionImpl.java:204)
      	at org.apache.hive.service.cli.CLIService.executeStatement(CLIService.java:168)
      	at org.apache.hive.service.cli.thrift.ThriftCLIService.ExecuteStatement(ThriftCLIService.java:316)
      	at org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement.getResult(TCLIService.java:1373)
      	at org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement.getResult(TCLIService.java:1358)
      	at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
      	at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
      	at org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge20S$Server$TUGIAssumingProcessor.process(HadoopThriftAuthBridge20S.java:608)
      	at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:244)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: MetaException(message:java.lang.RuntimeException: Unknown error for request: TRenamePrivilegesRequest(protocol_version:1, requestorUserName:hive, oldAuthorizable:TSentryAuthorizable(server:server1, db:db1, table:tb1), newAuthorizable:TSentryAuthorizable(server:server1, db:db1, table:tb2)), message: Failed to get privileges: Insert of object "org.apache.sentry.provider.db.service.model.MSentryPrivilege@7328027c" using statement "INSERT INTO `SENTRY_DB_PRIVILEGE` (`DB_PRIVILEGE_ID`,`DB_NAME`,`PRIVILEGE_NAME`,`TABLE_NAME`,`ACTION`,`GRANTOR_PRINCIPAL`,`PRIVILEGE_SCOPE`,`SERVER_NAME`,`URI`,`CREATE_TIME`) VALUES (?,?,?,?,?,?,?,?,?,?)" failed : Column 'GRANTOR_PRINCIPAL' cannot be null. Server Stacktrace: org.apache.sentry.provider.db.SentryInvalidInputException: Failed to get privileges: Insert of object "org.apache.sentry.provider.db.service.model.MSentryPrivilege@7328027c" using statement "INSERT INTO `SENTRY_DB_PRIVILEGE` (`DB_PRIVILEGE_ID`,`DB_NAME`,`PRIVILEGE_NAME`,`TABLE_NAME`,`ACTION`,`GRANTOR_PRINCIPAL`,`PRIVILEGE_SCOPE`,`SERVER_NAME`,`URI`,`CREATE_TIME`) VALUES (?,?,?,?,?,?,?,?,?,?)" failed : Column 'GRANTOR_PRINCIPAL' cannot be null
      	at org.apache.sentry.provider.db.service.persistent.SentryStore.renamePrivilege(SentryStore.java:1268)
      	at org.apache.sentry.provider.db.service.thrift.SentryPolicyStoreProcessor.rename_sentry_privilege(SentryPolicyStoreProcessor.java:479)
      	at org.apache.sentry.provider.db.service.thrift.SentryPolicyService$Processor$rename_sentry_privilege.getResult(SentryPolicyService.java:973)
      	at org.apache.sentry.provider.db.service.thrift.SentryPolicyService$Processor$rename_sentry_privilege.getResult(SentryPolicyService.java:958)
      	at sentry.org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
      	at sentry.org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
      	at sentry.org.apache.thrift.TMultiplexedProcessor.process(TMultiplexedProcessor.java:123)
      	at sentry.org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:244)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:745)
      )
      	at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$alter_table_with_environment_context_result$alter_table_with_environment_context_resultStandardScheme.read(ThriftHiveMetastore.java:31958)
      	at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$alter_table_with_environment_context_result$alter_table_with_environment_context_resultStandardScheme.read(ThriftHiveMetastore.java:31935)
      	at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$alter_table_with_environment_context_result.read(ThriftHiveMetastore.java:31877)
      	at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
      	at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.recv_alter_table_with_environment_context(ThriftHiveMetastore.java:1067)
      	at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.alter_table_with_environment_context(ThriftHiveMetastore.java:1051)
      	at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.alter_table(HiveMetaStoreClient.java:228)
      	at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.alter_table(HiveMetaStoreClient.java:223)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:89)
      	at com.sun.proxy.$Proxy12.alter_table(Unknown Source)
      	at org.apache.hadoop.hive.ql.metadata.Hive.alterTable(Hive.java:388)
      	... 25 more
      

        Attachments

        1. SENTRY-329.1.patch
          5 kB
          Prasad Suresh Mujumdar

          Issue Links

            Activity

              People

              • Assignee:
                prasadm Prasad Suresh Mujumdar
                Reporter:
                sravya Sravya Tirukkovalur
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: