[ https://issues.apache.org/jira/browse/HIVE-2800?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13291334#comment-13291334 ]
Sushanth Sowmyan commented on HIVE-2800: ---------------------------------------- Ashutosh, digging a bit more into thrift sources, this is what I find: http://svn.apache.org/repos/asf/thrift/trunk/lib/java/src/org/apache/thrift/protocol/TBinaryProtocol.java If you look at the method writeString there, it does not check for null, it calls str.getBytes(). So as of thrift trunk, this does not work. I'm not sure if that's intentional on thrift's part (to maximize speed by minimizing checks) and something to fix on hive's side, or something to fix on thrift's side. In the meanwhile, I've added a testcase for this bug in the RemoteHiveMetaStore, I'm updating the patch now. > NPE in "create index" without comment clause in external metastore > ------------------------------------------------------------------ > > Key: HIVE-2800 > URL: https://issues.apache.org/jira/browse/HIVE-2800 > Project: Hive > Issue Type: Bug > Components: Metastore > Affects Versions: 0.7.1, 0.8.1, 0.9.0 > Reporter: Daniel Dai > Assignee: Sushanth Sowmyan > Priority: Minor > > This happens only when using external metastore (with --hiveconf > hive.metastore.uris=thrift://localhost:8088 --hiveconf > hive.metastore.local=false). Also if I gave a comment in the statement, this > exception go away. > Here is the statement: > create index test111 on table hcat_test(name) as 'compact' with deferred > rebuild; > Here is the stack: > 2012-02-10 17:07:42,612 ERROR exec.Task (SessionState.java:printError(380)) - > FAILED: Error in metadata: java.lang.NullPointerException > org.apache.hadoop.hive.ql.metadata.HiveException: > java.lang.NullPointerException > at org.apache.hadoop.hive.ql.metadata.Hive.createIndex(Hive.java:725) > at > org.apache.hadoop.hive.ql.exec.DDLTask.createIndex(DDLTask.java:822) > at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:231) > at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:134) > at > org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:57) > at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1291) > at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1082) > at org.apache.hadoop.hive.ql.Driver.run(Driver.java:933) > at > org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:255) > at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:212) > at > org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:403) > at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:671) > at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:554) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at org.apache.hadoop.util.RunJar.main(RunJar.java:156) > Caused by: java.lang.NullPointerException > at > org.apache.thrift.protocol.TBinaryProtocol.writeString(TBinaryProtocol.java:185) > at org.apache.hadoop.hive.metastore.api.Index.write(Index.java:1032) > at > org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$add_index_args.write(ThriftHiveMetastore.java:47518) > at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:63) > at > org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.send_add_index(ThriftHiveMetastore.java:1675) > at > org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.add_index(ThriftHiveMetastore.java:1666) > at > org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createIndex(HiveMetaStoreClient.java:853) > at org.apache.hadoop.hive.ql.metadata.Hive.createIndex(Hive.java:722) > ... 17 more -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira