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

Alan Gates updated HIVE-10952:
------------------------------
    Attachment: HIVE-10952.patch

It turns out both Daniel and I were wrong on the issue here.  The problem is 
that HBaseStore is caching the table object and Hive.alterTable is changing the 
original object.  That confuses HBaseReadWrite when it goes to write back the 
object because it can't tell what's changed.

This patch fixes Hive.alterTable to make a copy before making changes.

> Describe a non-partitioned table fail
> -------------------------------------
>
>                 Key: HIVE-10952
>                 URL: https://issues.apache.org/jira/browse/HIVE-10952
>             Project: Hive
>          Issue Type: Sub-task
>          Components: Metastore
>            Reporter: Daniel Dai
>            Assignee: Alan Gates
>             Fix For: hbase-metastore-branch
>
>         Attachments: HIVE-10952-1.patch, HIVE-10952.patch
>
>
> This section of alter1.q fail:
> create table alter1(a int, b int);
> describe extended alter1;
> Exception:
> {code}
> Trying to fetch a non-existent storage descriptor from hash 
> iNVRGkfwwQDGK9oX0fo9XA==^M
>         at 
> org.apache.hadoop.hive.ql.parse.DDLSemanticAnalyzer$QualifiedNameUtil.getAttemptTableName(DDLSemanticAnalyzer.java:1765)
>         at 
> org.apache.hadoop.hive.ql.parse.DDLSemanticAnalyzer$QualifiedNameUtil.getTableName(DDLSemanticAnalyzer.java:1807)
>         at 
> org.apache.hadoop.hive.ql.parse.DDLSemanticAnalyzer.analyzeDescribeTable(DDLSemanticAnalyzer.java:1985)
>         at 
> org.apache.hadoop.hive.ql.parse.DDLSemanticAnalyzer.analyzeInternal(DDLSemanticAnalyzer.java:318)
>         at 
> org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:224)
>         at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:430)
>         at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:308)
>         at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1128)
>         at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1176)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1065)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1055)
>         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:1069)
>         at 
> org.apache.hadoop.hive.ql.QTestUtil.executeClient(QTestUtil.java:1043)
>         at 
> org.apache.hadoop.hive.cli.TestCliDriver.runTest(TestCliDriver.java:139)
>         at 
> org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_alter1(TestCliDriver.java:123)
>         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: org.apache.hadoop.hive.ql.metadata.HiveException: Unable to fetch 
> table alter1. java.lang.RuntimeException: Woh, bad!  Trying to fetch a 
> non-existent storage descriptor from hash iNVRGkfwwQDGK9oX0fo9XA==^M
>         at org.apache.hadoop.hive.ql.metadata.Hive.getTable(Hive.java:1121)
>         at org.apache.hadoop.hive.ql.metadata.Hive.getTable(Hive.java:1068)
>         at org.apache.hadoop.hive.ql.metadata.Hive.getTable(Hive.java:1055)
>         at 
> org.apache.hadoop.hive.ql.parse.DDLSemanticAnalyzer$QualifiedNameUtil.getAttemptTableName(DDLSemanticAnalyzer.java:1747)
> {code}
> The partitioned counterpart alter2.q pass.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to