Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-27193

Database names starting with '@' cause error during ALTER/DROP table.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 4.0.0-alpha-2
    • None
    • None

    Description

      The creation of database that start with '@' is supported:

       

      create database `@test`;

       

      The creation of a table in this database works:

       

      create table `@test`.testtable (c1 integer);

      However, dropping or altering the table result in an error:

       

      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)
      
      

       

      Relevant snippet of stack trace:

       

      {{}}

      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)
      ...

      {{}}

       

      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.

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            oschille Oliver Schiller
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: