Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-3349

DROP TABLE and DROP SEQUENCE not working with schemas



    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.8.1
    • Fix Version/s: 4.9.0, 4.8.2
    • Component/s: None
    • Labels:


      I am using 4.8.1 with HBase 1.2.3. I am talking to Phoenix using the Phoenix Query Server (Avatica)

      phoenix.schema.isNamespaceMappingEnabled is set to true in my configuration.

      To reproduce the problem:

      1. Execute CREATE SCHEMA IF NOT EXISTS myschema
      2. Open a connection to the query server and set the schema to myschema by setting the info map to

      {"schema": "myschema"}

      in the OpenConnectionRequest: https://calcite.apache.org/docs/avatica_protobuf_reference.html#openconnectionrequest
      2. Execute CREATE TABLE test_table1 (id integer not null primary key)
      3. ExecuteUPSERT INTO test_table1 (id) VALUES(1)

      Until this point, the schema and table were all created correctly. Upserting also works. If we check system.catalog, we can confirm that the table was created as myschema.test_table1.

      4. If we attempt to drop the table using the same connection, it neglects to include the schema, so it fails: DROP TABLE test_table1

       RuntimeException: org.apache.phoenix.schema.TableNotFoundException: ERROR 1012 (42M03): Table undefined. tableName=TEST_TABLE1 -> TableNotFoundException: ERROR 1012 (42M03): Table undefined. tableName=TEST_TABLE1

      The same problem can be reproduced with DROP SEQUENCE.


        1. PHOENIX-3349.patch
          5 kB
          Ankit Singhal



            • Assignee:
              ankit@apache.org Ankit Singhal
              francischuang Francis Chuang
            • Votes:
              0 Vote for this issue
              4 Start watching this issue


              • Created: