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

[jira] [Comment Edited] (HIVE-25964) Create iceberg table with ranger authorization failed with storage URI NullPointerException

    [ https://issues.apache.org/jira/browse/HIVE-25964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17493796#comment-17493796 ] 

zhangbutao edited comment on HIVE-25964 at 2/17/22, 9:07 AM:
-------------------------------------------------------------

StorageDescriptor won't initialize table location in the compile stage. Therefore, it will cause null exception when invoke StorageDescriptor getLocation method in IcebergTableUtil.

 
{code:java}
  static Table getTable(Configuration configuration, org.apache.hadoop.hive.metastore.api.Table hmsTable) {
    Properties properties = new Properties();

      //Null exception occurs on the following line
    properties.setProperty(Catalogs.NAME, TableIdentifier.of(hmsTable.getDbName(), hmsTable.getTableName()).toString());

    properties.setProperty(Catalogs.LOCATION, hmsTable.getSd().getLocation());
    if (hmsTable.getParameters().containsKey(InputFormatConfig.CATALOG_NAME)) {
      properties.setProperty(
          InputFormatConfig.CATALOG_NAME, hmsTable.getParameters().get(InputFormatConfig.CATALOG_NAME));
    }
    return getTable(configuration, properties);
  } {code}
 

 


was (Author: zhangbutao):
StorageDescriptor won't initialize table location in the compile stage. Therefore, it will cause null exception when invoke StorageDescriptor getLocation method in IcebergTableUtil.

 
{code:java}
  static Table getTable(Configuration configuration, org.apache.hadoop.hive.metastore.api.Table hmsTable) {
    Properties properties = new Properties();

      //An exception occurs on the following line
    properties.setProperty(Catalogs.NAME, TableIdentifier.of(hmsTable.getDbName(), hmsTable.getTableName()).toString());

    properties.setProperty(Catalogs.LOCATION, hmsTable.getSd().getLocation());
    if (hmsTable.getParameters().containsKey(InputFormatConfig.CATALOG_NAME)) {
      properties.setProperty(
          InputFormatConfig.CATALOG_NAME, hmsTable.getParameters().get(InputFormatConfig.CATALOG_NAME));
    }
    return getTable(configuration, properties);
  } {code}
 

 

> Create iceberg table  with ranger authorization failed with storage URI NullPointerException 
> ---------------------------------------------------------------------------------------------
>
>                 Key: HIVE-25964
>                 URL: https://issues.apache.org/jira/browse/HIVE-25964
>             Project: Hive
>          Issue Type: Bug
>          Components: Authorization, HiveServer2
>    Affects Versions: 4.0.0
>            Reporter: zhangbutao
>            Assignee: zhangbutao
>            Priority: Major
>
> set hive.security.authorization.enabled=true;
> set hive.security.authorization.managerorg.apache.ranger.authorization.hive.authorizer.RangerHiveAuthorizerFactory;
> create table test_ice(id int) stored by iceberg;
> {code:java}
> 2022-02-17T16:32:58,304 ERROR [6bf2c99a-72eb-4608-9189-b64bd59df590 HiveServer2-Handler-Pool: Thread-83] command.CommandAuthorizerV2: Exception occurred while getting the URI from storage handler: null
> java.lang.NullPointerException: null
>         at java.util.Hashtable.put(Hashtable.java:459) ~[?:1.8.0_112]
>         at java.util.Properties.setProperty(Properties.java:166) ~[?:1.8.0_112]
>         at org.apache.iceberg.mr.hive.IcebergTableUtil.getTable(IcebergTableUtil.java:87) ~[hive-iceberg-handler-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at org.apache.iceberg.mr.hive.HiveIcebergStorageHandler.getURIForAuth(HiveIcebergStorageHandler.java:372) ~[hive-iceberg-handler-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at org.apache.hadoop.hive.ql.security.authorization.command.CommandAuthorizerV2.addHivePrivObject(CommandAuthorizerV2.java:197) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at org.apache.hadoop.hive.ql.security.authorization.command.CommandAuthorizerV2.getHivePrivObjects(CommandAuthorizerV2.java:142) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at org.apache.hadoop.hive.ql.security.authorization.command.CommandAuthorizerV2.doAuthorization(CommandAuthorizerV2.java:76) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at org.apache.hadoop.hive.ql.security.authorization.command.CommandAuthorizer.doAuthorization(CommandAuthorizer.java:58) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at org.apache.hadoop.hive.ql.Compiler.authorize(Compiler.java:426) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at org.apache.hadoop.hive.ql.Compiler.compile(Compiler.java:112) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:501) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:453) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:417) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:411) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at org.apache.hadoop.hive.ql.reexec.ReExecDriver.compileAndRespond(ReExecDriver.java:121) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at org.apache.hive.service.cli.operation.SQLOperation.prepare(SQLOperation.java:204) ~[hive-service-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at org.apache.hive.service.cli.operation.SQLOperation.runInternal(SQLOperation.java:267) ~[hive-service-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at org.apache.hive.service.cli.operation.Operation.run(Operation.java:281) ~[hive-service-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at org.apache.hive.service.cli.session.HiveSessionImpl.executeStatementInternal(HiveSessionImpl.java:545) ~[hive-service-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at org.apache.hive.service.cli.session.HiveSessionImpl.executeStatementAsync(HiveSessionImpl.java:530) ~[hive-service-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_112]
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_112]
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_112]
>         at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_112]
>         at org.apache.hive.service.cli.session.HiveSessionProxy.invoke(HiveSessionProxy.java:78) ~[hive-service-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at org.apache.hive.service.cli.session.HiveSessionProxy.access$000(HiveSessionProxy.java:36) ~[hive-service-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at org.apache.hive.service.cli.session.HiveSessionProxy$1.run(HiveSessionProxy.java:63) ~[hive-service-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_112]
>         at javax.security.auth.Subject.doAs(Subject.java:422) ~[?:1.8.0_112]
>         at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1685) ~[hadoop-common-3.1.0-bc3.2.0.jar:?]
>         at org.apache.hive.service.cli.session.HiveSessionProxy.invoke(HiveSessionProxy.java:59) ~[hive-service-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at com.sun.proxy.$Proxy59.executeStatementAsync(Unknown Source) ~[?:?]
>         at org.apache.hive.service.cli.CLIService.executeStatementAsync(CLIService.java:316) ~[hive-service-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at org.apache.hive.service.cli.thrift.ThriftCLIService.ExecuteStatement(ThriftCLIService.java:653) ~[hive-service-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at org.apache.hive.service.rpc.thrift.TCLIService$Processor$ExecuteStatement.getResult(TCLIService.java:1670) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at org.apache.hive.service.rpc.thrift.TCLIService$Processor$ExecuteStatement.getResult(TCLIService.java:1650) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:38) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:38) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at org.apache.hive.service.auth.TSetIpAddressProcessor.process(TSetIpAddressProcessor.java:56) ~[hive-service-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:248) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[?:1.8.0_112]
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[?:1.8.0_112]
>         at java.lang.Thread.run(Thread.java:745) [?:1.8.0_112]
>  {code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)