Mahdi
Mahdi

Reputation: 1827

Retrieve existing hbase table's schema

I want to know is it possible to retrieve existing hbase table's schema ?

I want to know what's column families' name and so on.

if any .net or java code , I will really appreciate to post for me.

Upvotes: 1

Views: 503

Answers (1)

Leo Gamas
Leo Gamas

Reputation: 1231

Yes, it's possible. You only need to invoke HBaseAdmin.getTableDescriptor:

HBaseAdmin hbaseAdmin = new HBaseAdmin(config);
HTableDescriptor tableDescriptor = hbaseAdmin.getTableDescriptor(tableName)

The tableDescriptor object will contain all information about the table (families, etc).

Upvotes: 1

Related Questions