You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Anson Abraham <an...@gmail.com> on 2012/08/02 21:04:28 UTC

schema of hive database

is there a way to derive information (schema) off a hive table?

doing a describe only shows the clolumn w/ types.

But i want to know if a table is like this:

 ROW FORMAT   DELIMITED

    FIELDS TERMINATED BY '\t'

    COLLECTION ITEMS TERMINATED BY '\002'

    MAP KEYS TERMINATED BY '\003'

  STORED AS INPUTFORMAT 'com.hadoop.mapred.DeprecatedLzoTextInputFormat'
OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat';



Or like this:

ROW FORMAT   DELIMITED

    FIELDS TERMINATED BY '\t'

  STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat';


where can i find that info?


Thanks in advance.

Re: schema of hive database

Posted by Bejoy KS <be...@yahoo.com>.
Hi Techy

To use 'describe formatted' you need at least hive 0.7. But 'describe extended' should be available in hive 0.6 itself.

It is always better using the latest version. I recommend hive 0.9 at the moment. 


Regards
Bejoy KS

Sent from handheld, please excuse typos.

-----Original Message-----
From: Techy Teck <co...@gmail.com>
Date: Thu, 2 Aug 2012 14:54:06 
To: <us...@hive.apache.org>
Reply-To: user@hive.apache.org
Subject: Re: schema of hive database

Can you tell me what version you guys are using?

Can anyone tell me to use *describe formatted table1 *which version of hive
we need?




On Thu, Aug 2, 2012 at 1:12 PM, Sandeep Reddy P <sandeepreddy.3647@gmail.com
> wrote:

> Nice one worked for me.
>
>
> On Thu, Aug 2, 2012 at 4:03 PM, Anson Abraham <an...@gmail.com>wrote:
>
>> pretty much what you did.  I didn't realize that it was in the docs
>> already:
>>
>>
>> https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-DescribeTable%2FColumn
>>
>> Not sure, but I think this function is supported in 0.6  but I could be
>> wrong.
>>
>>
>> On Thu, Aug 2, 2012 at 3:59 PM, Techy Teck <co...@gmail.com>wrote:
>>
>>> And I got this error too-
>>>
>>> FAILED: Parse Error: line 1:19 mismatched input 'table1' expecting EOF
>>>
>>>
>>>
>>>
>>> On Thu, Aug 2, 2012 at 12:44 PM, Techy Teck <co...@gmail.com>wrote:
>>>
>>>> What format you used? I tried like this and it doesn't works for me-
>>>>
>>>> *describe formatted table1*
>>>>
>>>> I am running Hive 0.6. Anything else I need to do before running this
>>>> query?
>>>>
>>>>
>>>>
>>>>
>>>> On Thu, Aug 2, 2012 at 12:13 PM, Igor Tatarinov <ig...@decide.com>wrote:
>>>>
>>>>> Try
>>>>> describe formatted <table>
>>>>>
>>>>> igor
>>>>> decide.com
>>>>>
>>>>> On Thu, Aug 2, 2012 at 12:04 PM, Anson Abraham <
>>>>> anson.abraham@gmail.com> wrote:
>>>>>
>>>>>> is there a way to derive information (schema) off a hive table?
>>>>>>
>>>>>> doing a describe only shows the clolumn w/ types.
>>>>>>
>>>>>> But i want to know if a table is like this:
>>>>>>
>>>>>>  ROW FORMAT   DELIMITED
>>>>>>
>>>>>>     FIELDS TERMINATED BY '\t'
>>>>>>
>>>>>>     COLLECTION ITEMS TERMINATED BY '\002'
>>>>>>
>>>>>>     MAP KEYS TERMINATED BY '\003'
>>>>>>
>>>>>>   STORED AS INPUTFORMAT
>>>>>> 'com.hadoop.mapred.DeprecatedLzoTextInputFormat' OUTPUTFORMAT
>>>>>> 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat';
>>>>>>
>>>>>>
>>>>>>
>>>>>> Or like this:
>>>>>>
>>>>>> ROW FORMAT   DELIMITED
>>>>>>
>>>>>>     FIELDS TERMINATED BY '\t'
>>>>>>
>>>>>>   STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat'
>>>>>> OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat';
>>>>>>
>>>>>>
>>>>>> where can i find that info?
>>>>>>
>>>>>>
>>>>>> Thanks in advance.
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>
>
> --
> Thanks,
> sandeep
>
>


Re: schema of hive database

Posted by Techy Teck <co...@gmail.com>.
Can you tell me what version you guys are using?

Can anyone tell me to use *describe formatted table1 *which version of hive
we need?




On Thu, Aug 2, 2012 at 1:12 PM, Sandeep Reddy P <sandeepreddy.3647@gmail.com
> wrote:

> Nice one worked for me.
>
>
> On Thu, Aug 2, 2012 at 4:03 PM, Anson Abraham <an...@gmail.com>wrote:
>
>> pretty much what you did.  I didn't realize that it was in the docs
>> already:
>>
>>
>> https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-DescribeTable%2FColumn
>>
>> Not sure, but I think this function is supported in 0.6  but I could be
>> wrong.
>>
>>
>> On Thu, Aug 2, 2012 at 3:59 PM, Techy Teck <co...@gmail.com>wrote:
>>
>>> And I got this error too-
>>>
>>> FAILED: Parse Error: line 1:19 mismatched input 'table1' expecting EOF
>>>
>>>
>>>
>>>
>>> On Thu, Aug 2, 2012 at 12:44 PM, Techy Teck <co...@gmail.com>wrote:
>>>
>>>> What format you used? I tried like this and it doesn't works for me-
>>>>
>>>> *describe formatted table1*
>>>>
>>>> I am running Hive 0.6. Anything else I need to do before running this
>>>> query?
>>>>
>>>>
>>>>
>>>>
>>>> On Thu, Aug 2, 2012 at 12:13 PM, Igor Tatarinov <ig...@decide.com>wrote:
>>>>
>>>>> Try
>>>>> describe formatted <table>
>>>>>
>>>>> igor
>>>>> decide.com
>>>>>
>>>>> On Thu, Aug 2, 2012 at 12:04 PM, Anson Abraham <
>>>>> anson.abraham@gmail.com> wrote:
>>>>>
>>>>>> is there a way to derive information (schema) off a hive table?
>>>>>>
>>>>>> doing a describe only shows the clolumn w/ types.
>>>>>>
>>>>>> But i want to know if a table is like this:
>>>>>>
>>>>>>  ROW FORMAT   DELIMITED
>>>>>>
>>>>>>     FIELDS TERMINATED BY '\t'
>>>>>>
>>>>>>     COLLECTION ITEMS TERMINATED BY '\002'
>>>>>>
>>>>>>     MAP KEYS TERMINATED BY '\003'
>>>>>>
>>>>>>   STORED AS INPUTFORMAT
>>>>>> 'com.hadoop.mapred.DeprecatedLzoTextInputFormat' OUTPUTFORMAT
>>>>>> 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat';
>>>>>>
>>>>>>
>>>>>>
>>>>>> Or like this:
>>>>>>
>>>>>> ROW FORMAT   DELIMITED
>>>>>>
>>>>>>     FIELDS TERMINATED BY '\t'
>>>>>>
>>>>>>   STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat'
>>>>>> OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat';
>>>>>>
>>>>>>
>>>>>> where can i find that info?
>>>>>>
>>>>>>
>>>>>> Thanks in advance.
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>
>
> --
> Thanks,
> sandeep
>
>

Re: schema of hive database

Posted by Sandeep Reddy P <sa...@gmail.com>.
Nice one worked for me.

On Thu, Aug 2, 2012 at 4:03 PM, Anson Abraham <an...@gmail.com>wrote:

> pretty much what you did.  I didn't realize that it was in the docs
> already:
>
>
> https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-DescribeTable%2FColumn
>
> Not sure, but I think this function is supported in 0.6  but I could be
> wrong.
>
>
> On Thu, Aug 2, 2012 at 3:59 PM, Techy Teck <co...@gmail.com>wrote:
>
>> And I got this error too-
>>
>> FAILED: Parse Error: line 1:19 mismatched input 'table1' expecting EOF
>>
>>
>>
>>
>> On Thu, Aug 2, 2012 at 12:44 PM, Techy Teck <co...@gmail.com>wrote:
>>
>>> What format you used? I tried like this and it doesn't works for me-
>>>
>>> *describe formatted table1*
>>>
>>> I am running Hive 0.6. Anything else I need to do before running this
>>> query?
>>>
>>>
>>>
>>>
>>> On Thu, Aug 2, 2012 at 12:13 PM, Igor Tatarinov <ig...@decide.com> wrote:
>>>
>>>> Try
>>>> describe formatted <table>
>>>>
>>>> igor
>>>> decide.com
>>>>
>>>> On Thu, Aug 2, 2012 at 12:04 PM, Anson Abraham <anson.abraham@gmail.com
>>>> > wrote:
>>>>
>>>>> is there a way to derive information (schema) off a hive table?
>>>>>
>>>>> doing a describe only shows the clolumn w/ types.
>>>>>
>>>>> But i want to know if a table is like this:
>>>>>
>>>>>  ROW FORMAT   DELIMITED
>>>>>
>>>>>     FIELDS TERMINATED BY '\t'
>>>>>
>>>>>     COLLECTION ITEMS TERMINATED BY '\002'
>>>>>
>>>>>     MAP KEYS TERMINATED BY '\003'
>>>>>
>>>>>   STORED AS INPUTFORMAT
>>>>> 'com.hadoop.mapred.DeprecatedLzoTextInputFormat' OUTPUTFORMAT
>>>>> 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat';
>>>>>
>>>>>
>>>>>
>>>>> Or like this:
>>>>>
>>>>> ROW FORMAT   DELIMITED
>>>>>
>>>>>     FIELDS TERMINATED BY '\t'
>>>>>
>>>>>   STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat'
>>>>> OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat';
>>>>>
>>>>>
>>>>> where can i find that info?
>>>>>
>>>>>
>>>>> Thanks in advance.
>>>>>
>>>>>
>>>>
>>>
>>
>


-- 
Thanks,
sandeep

Re: schema of hive database

Posted by Anson Abraham <an...@gmail.com>.
pretty much what you did.  I didn't realize that it was in the docs already:

https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-DescribeTable%2FColumn

Not sure, but I think this function is supported in 0.6  but I could be
wrong.

On Thu, Aug 2, 2012 at 3:59 PM, Techy Teck <co...@gmail.com> wrote:

> And I got this error too-
>
> FAILED: Parse Error: line 1:19 mismatched input 'table1' expecting EOF
>
>
>
>
> On Thu, Aug 2, 2012 at 12:44 PM, Techy Teck <co...@gmail.com>wrote:
>
>> What format you used? I tried like this and it doesn't works for me-
>>
>> *describe formatted table1*
>>
>> I am running Hive 0.6. Anything else I need to do before running this
>> query?
>>
>>
>>
>>
>> On Thu, Aug 2, 2012 at 12:13 PM, Igor Tatarinov <ig...@decide.com> wrote:
>>
>>> Try
>>> describe formatted <table>
>>>
>>> igor
>>> decide.com
>>>
>>> On Thu, Aug 2, 2012 at 12:04 PM, Anson Abraham <an...@gmail.com>wrote:
>>>
>>>> is there a way to derive information (schema) off a hive table?
>>>>
>>>> doing a describe only shows the clolumn w/ types.
>>>>
>>>> But i want to know if a table is like this:
>>>>
>>>>  ROW FORMAT   DELIMITED
>>>>
>>>>     FIELDS TERMINATED BY '\t'
>>>>
>>>>     COLLECTION ITEMS TERMINATED BY '\002'
>>>>
>>>>     MAP KEYS TERMINATED BY '\003'
>>>>
>>>>   STORED AS INPUTFORMAT
>>>> 'com.hadoop.mapred.DeprecatedLzoTextInputFormat' OUTPUTFORMAT
>>>> 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat';
>>>>
>>>>
>>>>
>>>> Or like this:
>>>>
>>>> ROW FORMAT   DELIMITED
>>>>
>>>>     FIELDS TERMINATED BY '\t'
>>>>
>>>>   STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat'
>>>> OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat';
>>>>
>>>>
>>>> where can i find that info?
>>>>
>>>>
>>>> Thanks in advance.
>>>>
>>>>
>>>
>>
>

Re: schema of hive database

Posted by Techy Teck <co...@gmail.com>.
And I got this error too-

FAILED: Parse Error: line 1:19 mismatched input 'table1' expecting EOF




On Thu, Aug 2, 2012 at 12:44 PM, Techy Teck <co...@gmail.com> wrote:

> What format you used? I tried like this and it doesn't works for me-
>
> *describe formatted table1*
>
> I am running Hive 0.6. Anything else I need to do before running this
> query?
>
>
>
>
> On Thu, Aug 2, 2012 at 12:13 PM, Igor Tatarinov <ig...@decide.com> wrote:
>
>> Try
>> describe formatted <table>
>>
>> igor
>> decide.com
>>
>> On Thu, Aug 2, 2012 at 12:04 PM, Anson Abraham <an...@gmail.com>wrote:
>>
>>> is there a way to derive information (schema) off a hive table?
>>>
>>> doing a describe only shows the clolumn w/ types.
>>>
>>> But i want to know if a table is like this:
>>>
>>>  ROW FORMAT   DELIMITED
>>>
>>>     FIELDS TERMINATED BY '\t'
>>>
>>>     COLLECTION ITEMS TERMINATED BY '\002'
>>>
>>>     MAP KEYS TERMINATED BY '\003'
>>>
>>>   STORED AS INPUTFORMAT 'com.hadoop.mapred.DeprecatedLzoTextInputFormat'
>>> OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat';
>>>
>>>
>>>
>>> Or like this:
>>>
>>> ROW FORMAT   DELIMITED
>>>
>>>     FIELDS TERMINATED BY '\t'
>>>
>>>   STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat'
>>> OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat';
>>>
>>>
>>> where can i find that info?
>>>
>>>
>>> Thanks in advance.
>>>
>>>
>>
>

Re: schema of hive database

Posted by Techy Teck <co...@gmail.com>.
What format you used? I tried like this and it doesn't works for me-

*describe formatted table1*

I am running Hive 0.6. Anything else I need to do before running this query?




On Thu, Aug 2, 2012 at 12:13 PM, Igor Tatarinov <ig...@decide.com> wrote:

> Try
> describe formatted <table>
>
> igor
> decide.com
>
> On Thu, Aug 2, 2012 at 12:04 PM, Anson Abraham <an...@gmail.com>wrote:
>
>> is there a way to derive information (schema) off a hive table?
>>
>> doing a describe only shows the clolumn w/ types.
>>
>> But i want to know if a table is like this:
>>
>>  ROW FORMAT   DELIMITED
>>
>>     FIELDS TERMINATED BY '\t'
>>
>>     COLLECTION ITEMS TERMINATED BY '\002'
>>
>>     MAP KEYS TERMINATED BY '\003'
>>
>>   STORED AS INPUTFORMAT 'com.hadoop.mapred.DeprecatedLzoTextInputFormat'
>> OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat';
>>
>>
>>
>> Or like this:
>>
>> ROW FORMAT   DELIMITED
>>
>>     FIELDS TERMINATED BY '\t'
>>
>>   STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat'
>> OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat';
>>
>>
>> where can i find that info?
>>
>>
>> Thanks in advance.
>>
>>
>

Re: schema of hive database

Posted by Anson Abraham <an...@gmail.com>.
ah, works.  thanks.

On Thu, Aug 2, 2012 at 3:13 PM, Igor Tatarinov <ig...@decide.com> wrote:

> Try
> describe formatted <table>
>
> igor
> decide.com
>
> On Thu, Aug 2, 2012 at 12:04 PM, Anson Abraham <an...@gmail.com>wrote:
>
>> is there a way to derive information (schema) off a hive table?
>>
>> doing a describe only shows the clolumn w/ types.
>>
>> But i want to know if a table is like this:
>>
>>  ROW FORMAT   DELIMITED
>>
>>     FIELDS TERMINATED BY '\t'
>>
>>     COLLECTION ITEMS TERMINATED BY '\002'
>>
>>     MAP KEYS TERMINATED BY '\003'
>>
>>   STORED AS INPUTFORMAT 'com.hadoop.mapred.DeprecatedLzoTextInputFormat'
>> OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat';
>>
>>
>>
>> Or like this:
>>
>> ROW FORMAT   DELIMITED
>>
>>     FIELDS TERMINATED BY '\t'
>>
>>   STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat'
>> OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat';
>>
>>
>> where can i find that info?
>>
>>
>> Thanks in advance.
>>
>>
>

Re: schema of hive database

Posted by Igor Tatarinov <ig...@decide.com>.
Try
describe formatted <table>

igor
decide.com

On Thu, Aug 2, 2012 at 12:04 PM, Anson Abraham <an...@gmail.com>wrote:

> is there a way to derive information (schema) off a hive table?
>
> doing a describe only shows the clolumn w/ types.
>
> But i want to know if a table is like this:
>
>  ROW FORMAT   DELIMITED
>
>     FIELDS TERMINATED BY '\t'
>
>     COLLECTION ITEMS TERMINATED BY '\002'
>
>     MAP KEYS TERMINATED BY '\003'
>
>   STORED AS INPUTFORMAT 'com.hadoop.mapred.DeprecatedLzoTextInputFormat'
> OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat';
>
>
>
> Or like this:
>
> ROW FORMAT   DELIMITED
>
>     FIELDS TERMINATED BY '\t'
>
>   STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat'
> OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat';
>
>
> where can i find that info?
>
>
> Thanks in advance.
>
>

Re: schema of hive database

Posted by Edward Capriolo <ed...@gmail.com>.
Patch is forthcoming..

https://issues.apache.org/jira/browse/HIVE-967

There is a stand alone util referenced in the JIRA that you can use for now.



On Thu, Aug 2, 2012 at 3:04 PM, Anson Abraham <an...@gmail.com> wrote:
> is there a way to derive information (schema) off a hive table?
>
> doing a describe only shows the clolumn w/ types.
>
> But i want to know if a table is like this:
>
> ROW FORMAT   DELIMITED
>
>     FIELDS TERMINATED BY '\t'
>
>     COLLECTION ITEMS TERMINATED BY '\002'
>
>     MAP KEYS TERMINATED BY '\003'
>
>   STORED AS INPUTFORMAT 'com.hadoop.mapred.DeprecatedLzoTextInputFormat'
> OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat';
>
>
>
> Or like this:
>
> ROW FORMAT   DELIMITED
>
>     FIELDS TERMINATED BY '\t'
>
>   STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat'
> OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat';
>
>
> where can i find that info?
>
>
> Thanks in advance.