forcedotcom / phoenix

BSD 3-Clause "New" or "Revised" License
559 stars 227 forks source link

hbase shell list command can see the phoenix sql droped table #712

Closed hnucsbjd closed 10 years ago

hnucsbjd commented 10 years ago

the phoenix sql can drop table,index table name and data,but hbase shell 'list ' command can see the droped table and index table name,until hbase shell 'drop' command is excuted.

the operate steps:

0: jdbc:phoenix:192.168.147.92,192.168.147.93> drop table test;

0: jdbc:phoenix:192.168.147.92,192.168.147.93> !tables

+------------+-------------+------------+------------+------------+------------+ | TABLE_CAT | TABLE_SCHEM | TABLE_NAME | TABLE_TYPE | REMARKS | TYPE_NAME | +------------+-------------+------------+------------+------------+------------+ | null | SYSTEM | TABLE | s | null | null | +------------+-------------+------------+------------+------------+------------+

hbase(main):002:0> list TABLE
SYSTEM.TABLE
TEST
TEST_idx 3 row(s) in 0.2430 seconds

hbase(main):003:0> disable 'TEST' 0 row(s) in 3.1020 seconds

hbase(main):004:0> drop 'TEST' 0 row(s) in 3.1230 seconds

hbase(main):005:0> list TABLE
SYSTEM.TABLE

mravi commented 10 years ago

The table names are case sensitive, hence, try below from sqlline

drop table 'TEST';

jtaylor-sfdc commented 10 years ago

@hnucsbjd - if you upgrade to the latest version of Phoenix 2.2.2, the behavior is different now. By default, when you drop a Phoenix table, we'll also drop the HBase table.

@mravi - FYI, Phoenix table names are not case sensitive. Table names and column names are all upper cased automatically. You can force them to be case sensitive by surrounding them with double quotes.