Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

PhoenixDriver getSchema from connection-metaData,

PhoenixDriver getSchema from connection-metaData,

New Contributor

When trying to get the Schema and tables from existing HBASE, using phoenix driver. I am getting null as response.

How to get it?

,

Connection con = DriverManager.getConnection("jdbc:phoenix:zookeeper:2181:/hbase-unsecure");     stmt = con.createStatement();     String sche = con.getSchema();     log.debug("Schema from connection: "+sche);     DatabaseMetaData metaData = con.getMetaData();
ResultSet schemaResultset = metaData.getSchemas();
6 REPLIES 6

Re: PhoenixDriver getSchema from connection-metaData,

what do you mean by existing HBase? do you mean that you have some tables and you mapped them with Phoenix table by creating or view

Re: PhoenixDriver getSchema from connection-metaData,

New Contributor

@Ankit Singhal , no writing javaClient using the Phoenix Wrapper.

Re: PhoenixDriver getSchema from connection-metaData,

Super Guru

@Vivek Paranthaman what command are you using? I used !tables and got all info back

8731-aaa1.jpg

Re: PhoenixDriver getSchema from connection-metaData,

New Contributor

@Sunile ManjeeI am trying to write java-client, where by adding PhoenixDriver, to perform some operations. So I wanted to getSchema like normal SQL, from the metaData.

Connection con = ...

con.getMetaData().getSchema() ~ returns me null, or exception..!

Re: PhoenixDriver getSchema from connection-metaData,

Super Guru

Got it. Do you have code posted to github for me to review?

Highlighted

Re: PhoenixDriver getSchema from connection-metaData,

New Contributor

@Sunile Manjee updated the question itself..!

Don't have an account?
Coming from Hortonworks? Activate your account here