4

I created a Phoenix view company1:USERS for an existing HBase table. Namespace is company1 and table name is USERS. I don't have Phoenix table mapped to the existing Hbase table.

CREATE VIEW "company1:USERS" ( pk VARCHAR PRIMARY KEY, CF.USERNAME VARCHAR, CF.FULLNAME VARCHAR ); 

This create statement works fine. Now I want to drop it using this command: DROP VIEW "company1:USERS", but it gives me an error:

SQL Error [1012] [42M03]: ERROR 1012 (42M03): Table undefined. tableName=company1:USERS
  org.apache.phoenix.schema.TableNotFoundException: ERROR 1012 (42M03): Table undefined. tableName=company1:USERS

Same goes for the following delete statements:

  • DROP VIEW "company1.USERS"
  • DROP VIEW company1:USERS
  • DROP VIEW company1.USERS

Library used: phoenix-core-4.8.0-HBase-1.1

Any idea how to drop a Phoenix view with namespace?

Julius Delfino
  • 781
  • 6
  • 23

1 Answers1

2

I was able to achieve this by deleting from Phoenix SYSTEM tables:

DELETE FROM SYSTEM."STATS" WHERE PHYSICAL_NAME = 'company1:USERS';
DELETE FROM SYSTEM."CATALOG" WHERE TABLE_NAME = 'company1:USERS';
Julius Delfino
  • 781
  • 6
  • 23