[ https://issues.apache.org/jira/browse/HIVE-27193?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Denys Kuzmenko updated HIVE-27193: ---------------------------------- Priority: Minor (was: Major) > Database names starting with '@' cause error during ALTER/DROP table. > --------------------------------------------------------------------- > > Key: HIVE-27193 > URL: https://issues.apache.org/jira/browse/HIVE-27193 > Project: Hive > Issue Type: Bug > Components: Hive, Metastore, Standalone Metastore > Affects Versions: 4.0.0-alpha-2 > Reporter: Oliver Schiller > Priority: Minor > > The creation of database that start with '@' is supported: > > {code:java} > create database `@test`;{code} > > The creation of a table in this database works: > > {code:java} > create table `@test`.testtable (c1 integer);{code} > However, dropping or altering the table result in an error: > > {code:java} > drop table `@test`.testtable; > FAILED: SemanticException Unable to fetch table testtable. @test is prepended > with the catalog marker but does not appear to have a catalog name in it > Error: Error while compiling statement: FAILED: SemanticException Unable to > fetch table testtable. @test is prepended with the catalog marker but does > not appear to have a catalog name in it (state=42000,code=40000) > alter table `@test`.testtable add columns (c2 integer); > FAILED: SemanticException Unable to fetch table testtable. @test is prepended > with the catalog marker but does not appear to have a catalog name in it > Error: Error while compiling statement: FAILED: SemanticException Unable to > fetch table testtable. @test is prepended with the catalog marker but does > not appear to have a catalog name in it (state=42000,code=40000) > {code} > > Relevant snippet of stack trace: > > {{}} > {code:java} > org.apache.hadoop.hive.metastore.api.MetaException: @TEST is prepended with > the catalog marker but does not appear to have a catalog name in it at > org.apache.hadoop.hive.metastore.utils.MetaStoreUtils.parseDbName(MetaStoreUtils.java:1031 > at > org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.getTempTable(SessionHiveMetaStoreClient.java:651) > at > org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.getTable(SessionHiveMetaStoreClient.java:279) > at > org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.getTable(SessionHiveMetaStoreClient.java:273) > at > org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.getTable(SessionHiveMetaStoreClient.java:258) > at > org.apache.hadoop.hive.metastore.HiveMetaStoreClient.dropTable(HiveMetaStoreClient.java:1982)org.apache.hadoop.hive.metastore.HiveMetaStoreClient.dropTable(HiveMetaStoreClient.java:1957) > ...{code} > {{}} > > My suspicion is that this caused by the implementation of getTempTable and > how it is called. The method getTempTable calls parseDbName assuming that the > given dbname might be prefixed with a catalog name. I'm wondering whether > this is correct at this layer. From poking a bit around, it appears to me > that the catalog name is typically prepended when making the actual thrift > call. > > -- This message was sent by Atlassian Jira (v8.20.10#820010)