You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Patcharee Thongtra <Pa...@uni.no> on 2014/06/02 22:06:03 UTC

alter table add more columns

Hi,

I have a table named fino31 with the following schema

hive> describe fino31;
OK
date                    timestamp
zone                    int
z                       int
u                       float
v                       float
th                      float
qv                      float
ph                      float

# Partition Information
# col_name                data_type comment

zone                    int
z                       int
u                       float
v                       float
th                      float
qv                      float
ph                      float

Is it possible to alter this table later by adding more columns?

Patcharee

RE: alter table add more columns

Posted by Ricardo Birmele <Ri...@microsoft.com>.
Sorry for jumping in here…but could one of you be kind enough to point me to where I can get smarter on employing multiple partitions?  Specifically, I’m not looking for SQL guidance,

·         Column layout (do the partition column(s) have to be in any particular place in the DDL…like being the last few columns?)

·         File layout (how do I lay out a file folder structure in the Hive in order to accommodate multiple partitions?)
TIA,
__Birm

Ricardo Birmele, CISSP
Senior Security Technologist
Microsoft IT Security Operations
• | •••• | •

[Microsoft Logo]

From: Mohammad Tariq [mailto:dontariq@gmail.com]
Sent: Monday, 2 June, 2014 14:31
To: user
Subject: Re: alter table add more columns

Sorry for answering in a hurry. By "yes" I meant adding new partition value and not the partition column.

@Ashish : Thanks for the correction.

Warm regards,
Mohammad Tariq
cloudfront.blogspot.com<http://cloudfront.blogspot.com>

On Tue, Jun 3, 2014 at 2:52 AM, Ashish Garg <ga...@gmail.com>> wrote:
No, you can't add other partition column. you have to work with your current partitions.
Best Regards.
[https://mail.google.com/mail/u/0/images/cleardot.gif]

On Mon, Jun 2, 2014 at 5:22 PM, Ashish Garg <ga...@gmail.com>> wrote:
No, you can add other partition column. you have to work with your current partitions.
Best Regards.

On Mon, Jun 2, 2014 at 5:17 PM, Mohammad Tariq <do...@gmail.com>> wrote:
Yes.

Warm regards,
Mohammad Tariq
cloudfront.blogspot.com<http://cloudfront.blogspot.com>

On Tue, Jun 3, 2014 at 2:08 AM, Patcharee Thongtra <Pa...@uni.no>> wrote:
Hi,

Can I add a partition column?

Patcharee


On 06/02/2014 10:25 PM, Mohammad Tariq wrote:
Hi Patcharee,

You can definitely add new columns. This is how it is done :

ALTER TABLE table_name ADD|REPLACE COLUMNS (col_name data_type [COMMENT col_comment], ...)

For more info on Hive DDL you can visit this link<https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL>.

Warm regards,
Mohammad Tariq
cloudfront.blogspot.com<http://cloudfront.blogspot.com>

On Tue, Jun 3, 2014 at 1:36 AM, Patcharee Thongtra <Pa...@uni.no>> wrote:
Hi,

I have a table named fino31 with the following schema

hive> describe fino31;
OK
date                    timestamp
zone                    int
z                       int
u                       float
v                       float
th                      float
qv                      float
ph                      float

# Partition Information
# col_name                data_type comment

zone                    int
z                       int
u                       float
v                       float
th                      float
qv                      float
ph                      float

Is it possible to alter this table later by adding more columns?

Patcharee







Re: alter table add more columns

Posted by Mohammad Tariq <do...@gmail.com>.
Sorry for answering in a hurry. By "yes" I meant adding new partition value
and not the partition column.

@Ashish : Thanks for the correction.

*Warm regards,*
*Mohammad Tariq*
*cloudfront.blogspot.com <http://cloudfront.blogspot.com>*


On Tue, Jun 3, 2014 at 2:52 AM, Ashish Garg <ga...@gmail.com>
wrote:

> No, you can't add other partition column. you have to work with your
> current partitions.
> Best Regards.
>
>
> On Mon, Jun 2, 2014 at 5:22 PM, Ashish Garg <ga...@gmail.com>
> wrote:
>
>> No, you can add other partition column. you have to work with your
>> current partitions.
>> Best Regards.
>>
>>
>> On Mon, Jun 2, 2014 at 5:17 PM, Mohammad Tariq <do...@gmail.com>
>> wrote:
>>
>>> Yes.
>>>
>>> *Warm regards,*
>>> *Mohammad Tariq*
>>> *cloudfront.blogspot.com <http://cloudfront.blogspot.com>*
>>>
>>>
>>> On Tue, Jun 3, 2014 at 2:08 AM, Patcharee Thongtra <
>>> Patcharee.Thongtra@uni.no> wrote:
>>>
>>>>  Hi,
>>>>
>>>> Can I add a partition column?
>>>>
>>>> Patcharee
>>>>
>>>>
>>>> On 06/02/2014 10:25 PM, Mohammad Tariq wrote:
>>>>
>>>>  Hi Patcharee,
>>>>
>>>>  You can definitely add new columns. This is how it is done :
>>>>
>>>> *ALTER TABLE table_name ADD|REPLACE COLUMNS (col_name data_type
>>>> [COMMENT col_comment], ...)*
>>>>
>>>>  For more info on Hive DDL you can visit this link
>>>> <https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL>.
>>>>
>>>>  *Warm regards,*
>>>> *Mohammad Tariq*
>>>> *cloudfront.blogspot.com <http://cloudfront.blogspot.com>*
>>>>
>>>>
>>>> On Tue, Jun 3, 2014 at 1:36 AM, Patcharee Thongtra <
>>>> Patcharee.Thongtra@uni.no> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I have a table named fino31 with the following schema
>>>>>
>>>>> hive> describe fino31;
>>>>> OK
>>>>> date                    timestamp
>>>>> zone                    int
>>>>> z                       int
>>>>> u                       float
>>>>> v                       float
>>>>> th                      float
>>>>> qv                      float
>>>>> ph                      float
>>>>>
>>>>> # Partition Information
>>>>> # col_name                data_type comment
>>>>>
>>>>> zone                    int
>>>>> z                       int
>>>>> u                       float
>>>>> v                       float
>>>>> th                      float
>>>>> qv                      float
>>>>> ph                      float
>>>>>
>>>>> Is it possible to alter this table later by adding more columns?
>>>>>
>>>>> Patcharee
>>>>>
>>>>
>>>>
>>>>
>>>
>>
>

Re: alter table add more columns

Posted by Ashish Garg <ga...@gmail.com>.
No, you can't add other partition column. you have to work with your
current partitions.
Best Regards.


On Mon, Jun 2, 2014 at 5:22 PM, Ashish Garg <ga...@gmail.com>
wrote:

> No, you can add other partition column. you have to work with your current
> partitions.
> Best Regards.
>
>
> On Mon, Jun 2, 2014 at 5:17 PM, Mohammad Tariq <do...@gmail.com> wrote:
>
>> Yes.
>>
>> *Warm regards,*
>> *Mohammad Tariq*
>> *cloudfront.blogspot.com <http://cloudfront.blogspot.com>*
>>
>>
>> On Tue, Jun 3, 2014 at 2:08 AM, Patcharee Thongtra <
>> Patcharee.Thongtra@uni.no> wrote:
>>
>>>  Hi,
>>>
>>> Can I add a partition column?
>>>
>>> Patcharee
>>>
>>>
>>> On 06/02/2014 10:25 PM, Mohammad Tariq wrote:
>>>
>>>  Hi Patcharee,
>>>
>>>  You can definitely add new columns. This is how it is done :
>>>
>>> *ALTER TABLE table_name ADD|REPLACE COLUMNS (col_name data_type [COMMENT
>>> col_comment], ...)*
>>>
>>>  For more info on Hive DDL you can visit this link
>>> <https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL>.
>>>
>>>  *Warm regards,*
>>> *Mohammad Tariq*
>>> *cloudfront.blogspot.com <http://cloudfront.blogspot.com>*
>>>
>>>
>>> On Tue, Jun 3, 2014 at 1:36 AM, Patcharee Thongtra <
>>> Patcharee.Thongtra@uni.no> wrote:
>>>
>>>> Hi,
>>>>
>>>> I have a table named fino31 with the following schema
>>>>
>>>> hive> describe fino31;
>>>> OK
>>>> date                    timestamp
>>>> zone                    int
>>>> z                       int
>>>> u                       float
>>>> v                       float
>>>> th                      float
>>>> qv                      float
>>>> ph                      float
>>>>
>>>> # Partition Information
>>>> # col_name                data_type comment
>>>>
>>>> zone                    int
>>>> z                       int
>>>> u                       float
>>>> v                       float
>>>> th                      float
>>>> qv                      float
>>>> ph                      float
>>>>
>>>> Is it possible to alter this table later by adding more columns?
>>>>
>>>> Patcharee
>>>>
>>>
>>>
>>>
>>
>

Re: alter table add more columns

Posted by Ashish Garg <ga...@gmail.com>.
No, you can add other partition column. you have to work with your current
partitions.
Best Regards.


On Mon, Jun 2, 2014 at 5:17 PM, Mohammad Tariq <do...@gmail.com> wrote:

> Yes.
>
> *Warm regards,*
> *Mohammad Tariq*
> *cloudfront.blogspot.com <http://cloudfront.blogspot.com>*
>
>
> On Tue, Jun 3, 2014 at 2:08 AM, Patcharee Thongtra <
> Patcharee.Thongtra@uni.no> wrote:
>
>>  Hi,
>>
>> Can I add a partition column?
>>
>> Patcharee
>>
>>
>> On 06/02/2014 10:25 PM, Mohammad Tariq wrote:
>>
>>  Hi Patcharee,
>>
>>  You can definitely add new columns. This is how it is done :
>>
>> *ALTER TABLE table_name ADD|REPLACE COLUMNS (col_name data_type [COMMENT
>> col_comment], ...)*
>>
>>  For more info on Hive DDL you can visit this link
>> <https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL>.
>>
>>  *Warm regards,*
>> *Mohammad Tariq*
>> *cloudfront.blogspot.com <http://cloudfront.blogspot.com>*
>>
>>
>> On Tue, Jun 3, 2014 at 1:36 AM, Patcharee Thongtra <
>> Patcharee.Thongtra@uni.no> wrote:
>>
>>> Hi,
>>>
>>> I have a table named fino31 with the following schema
>>>
>>> hive> describe fino31;
>>> OK
>>> date                    timestamp
>>> zone                    int
>>> z                       int
>>> u                       float
>>> v                       float
>>> th                      float
>>> qv                      float
>>> ph                      float
>>>
>>> # Partition Information
>>> # col_name                data_type comment
>>>
>>> zone                    int
>>> z                       int
>>> u                       float
>>> v                       float
>>> th                      float
>>> qv                      float
>>> ph                      float
>>>
>>> Is it possible to alter this table later by adding more columns?
>>>
>>> Patcharee
>>>
>>
>>
>>
>

Re: alter table add more columns

Posted by Mohammad Tariq <do...@gmail.com>.
Yes.

*Warm regards,*
*Mohammad Tariq*
*cloudfront.blogspot.com <http://cloudfront.blogspot.com>*


On Tue, Jun 3, 2014 at 2:08 AM, Patcharee Thongtra <
Patcharee.Thongtra@uni.no> wrote:

>  Hi,
>
> Can I add a partition column?
>
> Patcharee
>
>
> On 06/02/2014 10:25 PM, Mohammad Tariq wrote:
>
>  Hi Patcharee,
>
>  You can definitely add new columns. This is how it is done :
>
> *ALTER TABLE table_name ADD|REPLACE COLUMNS (col_name data_type [COMMENT
> col_comment], ...)*
>
>  For more info on Hive DDL you can visit this link
> <https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL>.
>
>  *Warm regards,*
> *Mohammad Tariq*
> *cloudfront.blogspot.com <http://cloudfront.blogspot.com>*
>
>
> On Tue, Jun 3, 2014 at 1:36 AM, Patcharee Thongtra <
> Patcharee.Thongtra@uni.no> wrote:
>
>> Hi,
>>
>> I have a table named fino31 with the following schema
>>
>> hive> describe fino31;
>> OK
>> date                    timestamp
>> zone                    int
>> z                       int
>> u                       float
>> v                       float
>> th                      float
>> qv                      float
>> ph                      float
>>
>> # Partition Information
>> # col_name                data_type comment
>>
>> zone                    int
>> z                       int
>> u                       float
>> v                       float
>> th                      float
>> qv                      float
>> ph                      float
>>
>> Is it possible to alter this table later by adding more columns?
>>
>> Patcharee
>>
>
>
>

Hadoop summit San Jose 5/3/14 - 5/5/14

Posted by Sanjay Subramanian <sa...@yahoo.com>.
hi guys 

I am going to attend the 3 day hadoop summit in San Jose tomorrow. Looking fwd to the Hive sessions.

Hope to see many of u there.

regards

sanjay

Re: alter table add more columns

Posted by Patcharee Thongtra <Pa...@uni.no>.
Hi,

Can I add a partition column?

Patcharee

On 06/02/2014 10:25 PM, Mohammad Tariq wrote:
> Hi Patcharee,
>
> You can definitely add new columns. This is how it is done :
>
> *ALTER TABLE table_name ADD|REPLACE COLUMNS (col_name data_type 
> [COMMENT col_comment], ...)*
>
> For more info on Hive DDL you can visit this link 
> <https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL>.
>
> *Warm regards,*
> *Mohammad Tariq*
> /cloudfront.blogspot.com <http://cloudfront.blogspot.com>/
>
>
> On Tue, Jun 3, 2014 at 1:36 AM, Patcharee Thongtra 
> <Patcharee.Thongtra@uni.no <ma...@uni.no>> wrote:
>
>     Hi,
>
>     I have a table named fino31 with the following schema
>
>     hive> describe fino31;
>     OK
>     date                    timestamp
>     zone                    int
>     z                       int
>     u                       float
>     v                       float
>     th                      float
>     qv                      float
>     ph                      float
>
>     # Partition Information
>     # col_name                data_type comment
>
>     zone                    int
>     z                       int
>     u                       float
>     v                       float
>     th                      float
>     qv                      float
>     ph                      float
>
>     Is it possible to alter this table later by adding more columns?
>
>     Patcharee
>
>


Re: alter table add more columns

Posted by Mohammad Tariq <do...@gmail.com>.
Hi Patcharee,

You can definitely add new columns. This is how it is done :

*ALTER TABLE table_name ADD|REPLACE COLUMNS (col_name data_type [COMMENT
col_comment], ...)*

For more info on Hive DDL you can visit this link
<https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL>.

*Warm regards,*
*Mohammad Tariq*
*cloudfront.blogspot.com <http://cloudfront.blogspot.com>*


On Tue, Jun 3, 2014 at 1:36 AM, Patcharee Thongtra <
Patcharee.Thongtra@uni.no> wrote:

> Hi,
>
> I have a table named fino31 with the following schema
>
> hive> describe fino31;
> OK
> date                    timestamp
> zone                    int
> z                       int
> u                       float
> v                       float
> th                      float
> qv                      float
> ph                      float
>
> # Partition Information
> # col_name                data_type comment
>
> zone                    int
> z                       int
> u                       float
> v                       float
> th                      float
> qv                      float
> ph                      float
>
> Is it possible to alter this table later by adding more columns?
>
> Patcharee
>