Weibo Li
Weibo Li

Reputation: 3605

How to export table schemas in apache phoenix?

I'd like to export the schema of an existing table in apache phoenix. Are there some commands or tools to do the same thing as show create table TABLE_NAME in mysql?

thx

Upvotes: 10

Views: 10080

Answers (4)

Evhz
Evhz

Reputation: 9238

This solution works great.

SELECT column_name
  FROM system.catalog
  WHERE table_name = 'your_table' AND key_seq IS NOT NULL

Upvotes: 1

kliew
kliew

Reputation: 3183

Using the Phoenix sqlline tool: !describe <table>

Upvotes: 4

Thomas Decaux
Thomas Decaux

Reputation: 22661

Since "native" HBase is schema-less (you can only specify column families), this is not possible.

Or you could scan some rows to extract columns with types

Upvotes: -3

Chux Uzoeto
Chux Uzoeto

Reputation: 1404

Apache Phoenix is typically used as a SQL front or interface to a NoSQL DB (like Hadoop). Perhaps it would help if you were more specific about the challenges you are trying to address.

Upvotes: -1

Related Questions