You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Stamatis Zampetakis (Jira)" <ji...@apache.org> on 2022/10/21 07:21:01 UTC

[jira] [Updated] (HIVE-11085) Alter table fail with NPE if schema change

     [ https://issues.apache.org/jira/browse/HIVE-11085?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stamatis Zampetakis updated HIVE-11085:
---------------------------------------

I cleared the fixVersion field since this ticket is still open. Please review this ticket and if the fix is already committed to a specific version please set the version accordingly and mark the ticket as RESOLVED.

According to the [JIRA guidelines|https://cwiki.apache.org/confluence/display/Hive/HowToContribute] the fixVersion should be set only when the issue is resolved/closed.

> Alter table fail with NPE if schema change
> ------------------------------------------
>
>                 Key: HIVE-11085
>                 URL: https://issues.apache.org/jira/browse/HIVE-11085
>             Project: Hive
>          Issue Type: Bug
>          Components: Metastore
>            Reporter: Daniel Dai
>            Priority: Major
>             Fix For: hbase-metastore-branch
>
>
> alter1.q fail. Specifically, the following statement fail:
> create table alter1(a int, b int);
> add jar itests/test-serde/target/hive-it-test-serde-1.3.0-SNAPSHOT.jar;
> alter table alter1 set serde 'org.apache.hadoop.hive.serde2.TestSerDe' with serdeproperties('s1'='9');
> Error stack:
> {code}
> org.apache.hadoop.hive.ql.metadata.HiveException: Unable to alter table. java.lang.NullPointerException
>         at org.apache.hadoop.hive.ql.metadata.Hive.alterTable(Hive.java:498)
>         at org.apache.hadoop.hive.ql.exec.DDLTask.alterTable(DDLTask.java:3418)
>         at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:338)
>         at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:160)
>         at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:89)
>         at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1660)
>         at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1419)
>         at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1200)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1067)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1057)
>         at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:213)
>         at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:165)
>         at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:376)
>         at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:311)
>         at org.apache.hadoop.hive.ql.QTestUtil.executeClientInternal(QTestUtil.java:1116)
>         at org.apache.hadoop.hive.ql.QTestUtil.executeClient(QTestUtil.java:1090)
>         at org.apache.hadoop.hive.cli.TestCliDriver.runTest(TestCliDriver.java:146)
>         at org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_alter1(TestCliDriver.java:130)
>         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 junit.framework.TestCase.runTest(TestCase.java:176)
>         at junit.framework.TestCase.runBare(TestCase.java:141)
>         at junit.framework.TestResult$1.protect(TestResult.java:122)
>         at junit.framework.TestResult.runProtected(TestResult.java:142)
>         at junit.framework.TestResult.run(TestResult.java:125)
>         at junit.framework.TestCase.run(TestCase.java:129)
>         at junit.framework.TestSuite.runTest(TestSuite.java:255)
>         at junit.framework.TestSuite.run(TestSuite.java:250)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
>         at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
>         at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
>         at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
>         at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
>         at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
> Caused by: MetaException(message:java.lang.NullPointerException)
>         at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.newMetaException(HiveMetaStore.java:5301)
>         at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.alter_table_core(HiveMetaStore.java:3443)
>         at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.alter_table_with_cascade(HiveMetaStore.java:3395)
>         at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.alter_table(HiveMetaStoreClient.java:352)
>         at org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.alter_table(SessionHiveMetaStoreClient.java:251)
>         at org.apache.hadoop.hive.ql.metadata.Hive.alterTable(Hive.java:496)
>         ... 36 more
> Caused by: java.lang.NullPointerException
>         at org.apache.hadoop.hive.metastore.HiveAlterHandler.updateTableColumnStatsForAlterTable(HiveAlterHandler.java:673)
>         at org.apache.hadoop.hive.metastore.HiveAlterHandler.alterTable(HiveAlterHandler.java:241)
>         at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.alter_table_core(HiveMetaStore.java:3423)
> {code}
> If changing the alter statement to:
> alter table alter1 set serde 'org.apache.hadoop.hive.ql.io.orc.OrcSerde' with serdeproperties('s1'='9');
> The test pass. The difference is the former also changes the schema which trigger the NPE.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)