You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@phoenix.apache.org by Kevin Verhoeven <Ke...@ds-iq.com> on 2015/07/14 01:57:09 UTC

Query DDL from Phoenix

Is there a way to query the table structure of user tables from Phoenix? For example, to retrieve the CREATE TABLE syntax?

Thank you,

Kevin Verhoeven


Re: Query DDL from Phoenix

Posted by Leon Prouger <le...@gmail.com>.
You can use !describe <tablename> or !tables from the sqlline. Also typing
!help you can find other helpful things
On יום ג׳, 14 ביול 2015 at 06:52 Eli Levine <el...@gmail.com> wrote:

> The standard JDBC way is to use Connection.getMetadata(). See if that does
> what you need. You can also query SYSTEM.TABLE directly via Phoenix if you
> know what you are doing.
>
>
>
> On Jul 13, 2015, at 4:57 PM, Kevin Verhoeven <Ke...@ds-iq.com>
> wrote:
>
>  Is there a way to query the table structure of user tables from Phoenix?
> For example, to retrieve the CREATE TABLE syntax?
>
>
>
> Thank you,
>
>
>
> Kevin Verhoeven
>
>
>
>

RE: Query DDL from Phoenix

Posted by Kevin Verhoeven <Ke...@ds-iq.com>.
Thank you for your input, I appreciate your help!

Kevin

From: Cody Marcel [mailto:cmarcel@salesforce.com]
Sent: Tuesday, July 14, 2015 9:18 AM
To: user@phoenix.apache.org
Subject: Re: Query DDL from Phoenix

This should do it.


DatabaseMetaData dbmd = connection.getMetaData();
ResultSet resultSet = dbmd.getColumns(null, schemaName, tableName, null);

On Mon, Jul 13, 2015 at 8:51 PM, Eli Levine <el...@gmail.com>> wrote:
The standard JDBC way is to use Connection.getMetadata(). See if that does what you need. You can also query SYSTEM.TABLE directly via Phoenix if you know what you are doing.


On Jul 13, 2015, at 4:57 PM, Kevin Verhoeven <Ke...@ds-iq.com>> wrote:
Is there a way to query the table structure of user tables from Phoenix? For example, to retrieve the CREATE TABLE syntax?

Thank you,

Kevin Verhoeven



Re: Query DDL from Phoenix

Posted by Cody Marcel <cm...@salesforce.com>.
This should do it.

DatabaseMetaData dbmd = connection.getMetaData();
ResultSet resultSet = dbmd.getColumns(null, schemaName, tableName, null);


On Mon, Jul 13, 2015 at 8:51 PM, Eli Levine <el...@gmail.com> wrote:

> The standard JDBC way is to use Connection.getMetadata(). See if that does
> what you need. You can also query SYSTEM.TABLE directly via Phoenix if you
> know what you are doing.
>
>
>
> On Jul 13, 2015, at 4:57 PM, Kevin Verhoeven <Ke...@ds-iq.com>
> wrote:
>
>  Is there a way to query the table structure of user tables from Phoenix?
> For example, to retrieve the CREATE TABLE syntax?
>
>
>
> Thank you,
>
>
>
> Kevin Verhoeven
>
>
>
>

Re: Query DDL from Phoenix

Posted by Eli Levine <el...@gmail.com>.
The standard JDBC way is to use Connection.getMetadata(). See if that does what you need. You can also query SYSTEM.TABLE directly via Phoenix if you know what you are doing. 



> On Jul 13, 2015, at 4:57 PM, Kevin Verhoeven <Ke...@ds-iq.com> wrote:
> 
> Is there a way to query the table structure of user tables from Phoenix? For example, to retrieve the CREATE TABLE syntax?  
>  
> Thank you,
>  
> Kevin Verhoeven
>