0

How can I drop a schema that contains tables in HBase using Phoenix?

  • HBase version :1.2.6
  • Phoenix Version : 4.10.0-Hbase-1.2.0

I am trying to drop a schema, but I'm unable to do it. My schema consists of some tables.

I get an error that the schema is not empty. How can I drop the schema in that case? What extra do I have to do?

This is the Java code using Phoenix to drop schema from HBase:

Connection conn = setupDbConnection();  
statement = conn.createStatement();  
statement.executeUpdate("DROP SCHEMA "+schemaName);  
conn.commit();
Benjamin W.
  • 46,058
  • 19
  • 106
  • 116
Vishal Biradar
  • 1,219
  • 2
  • 12
  • 24

1 Answers1

0

https://phoenix.apache.org/language/#drop_schema

Drops a schema and corresponding name-space from hbase. To enable namespace mapping, see https://phoenix.apache.org/tuning.html

This statement succeed only when schema doesn't hold any tables.

Is this setting configured?

phoenix.schema.isNamespaceMappingEnabled to true
Paul Bastide
  • 1,505
  • 4
  • 17
  • 22
  • yes I configured those setting in hbase-site.xml and as well as in my client program too. But the error is that the schema/namespace is not empty.So my question is how to drop schema when it contains some tables. – Vishal Biradar Jun 27 '17 at 04:48