You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by wd <wd...@wdicc.com> on 2012/05/31 09:19:22 UTC

Hive partition problem

hi,

We setup a new hive 0.9 client, Found some sql did not work, for example

hive> create table t1(a int) partitioned by ( dt int );
OK
Time taken: 0.097 seconds
hive> load data local inpath '/tmp/t' into table t1 partition (dt=111);
Copying data from file:/tmp/t
Copying file: file:/tmp/t
Loading data to table default.t1 partition (dt=111)
OK
Time taken: 0.375 seconds
hive> show partitions t1;
OK
dt=111
Time taken: 0.108 seconds
hive> alter table t1 drop partition ( dt=111 );
FAILED: Error in semantic analysis: Partition not found dt = 111
hive> alter table t1 drop partition ( dt='111' );
FAILED: Error in semantic analysis: Partition not found dt = '111'


So, how to delete the partition?

Re: Hive partition problem

Posted by wd <wd...@wdicc.com>.
It's too bad.
I've file a issue at hive jira, https://issues.apache.org/jira/browse/HIVE-3069.

On Thu, May 31, 2012 at 5:16 PM, Malcolm Tye <ma...@btinternet.com> wrote:
> Hi,
>        We used to use integer partitioning for 2 columns, "year_month_day"
> and "hour"
>
> When it came to dropping 1 partition for an hour for a particular day, it
> seemed to drop all of the hour partitions for the day.
>
> IMO it's a bug. We just moved to using text
>
>
> Malc
>
>
> -----Original Message-----
> From: wd [mailto:wd@wdicc.com]
> Sent: 31 May 2012 09:32
> To: user@hive.apache.org
> Subject: Re: Hive partition problem
>
> Is this a bug? Should I report a bug to hive?
>
> On Thu, May 31, 2012 at 3:56 PM, wd <wd...@wdicc.com> wrote:
>> Still no useful output. But we found the problem.
>>
>> When the partition col type is int, it can't be droped. After change
>> it to string, it can be droped.
>>
>> On Thu, May 31, 2012 at 3:48 PM, Aniket Mokashi <an...@gmail.com>
> wrote:
>>> -hiveconf hive.root.logger=DEBUG,FA \
>>>     -hiveconf hive.log.dir="$logDir" \
>>>     -hiveconf hive.log.file="$logFile" \
>>>
>>> On Thu, May 31, 2012 at 12:41 AM, wd <wd...@wdicc.com> wrote:
>>>>
>>>> Nothing output in hive history file, is there an other log file or
>>>> an option to output detail log ?
>>>>
>>>> On Thu, May 31, 2012 at 3:34 PM, Aniket Mokashi
>>>> <an...@gmail.com>
>>>> wrote:
>>>> > You should look at hive log and find exact exception. That will
>>>> > give you a hint.
>>>> >
>>>> >
>>>> > On Thu, May 31, 2012 at 12:33 AM, wd <wd...@wdicc.com> wrote:
>>>> >>
>>>> >> No problem, thanks for your reply.
>>>> >> I'm very curious why this didn't work, this sql come from hive wiki.
>>>> >> The metadata is store in postgres, does it matter?
>>>> >>
>>>> >> On Thu, May 31, 2012 at 3:26 PM, Bhavesh Shah
>>>> >> <bh...@gmail.com>
>>>> >> wrote:
>>>> >> > Sorry for previous reply. Actually you had try that one, I
>>>> >> > didn't saw that.
>>>> >> > Really Sorry.
>>>> >> >
>>>> >> > On Thu, May 31, 2012 at 12:53 PM, Bhavesh Shah
>>>> >> > <bh...@gmail.com>
>>>> >> > wrote:
>>>> >> >>
>>>> >> >> Hello wd,
>>>> >> >> Try this one... I am not sure about this ALTER TABLE t1 DROP
>>>> >> >> PARTITION(dt = '111')
>>>> >> >>
>>>> >> >>
>>>> >> >> --
>>>> >> >> Regards,
>>>> >> >> Bhavesh Shah
>>>> >> >>
>>>> >> >>
>>>> >> >> On Thu, May 31, 2012 at 12:49 PM, wd <wd...@wdicc.com> wrote:
>>>> >> >>>
>>>> >> >>> hi,
>>>> >> >>>
>>>> >> >>> We setup a new hive 0.9 client, Found some sql did not work,
>>>> >> >>> for example
>>>> >> >>>
>>>> >> >>> hive> create table t1(a int) partitioned by ( dt int );
>>>> >> >>> OK
>>>> >> >>> Time taken: 0.097 seconds
>>>> >> >>> hive> load data local inpath '/tmp/t' into table t1 partition
>>>> >> >>> (dt=111);
>>>> >> >>> Copying data from file:/tmp/t Copying file: file:/tmp/t
>>>> >> >>> Loading data to table default.t1 partition (dt=111) OK Time
>>>> >> >>> taken: 0.375 seconds
>>>> >> >>> hive> show partitions t1;
>>>> >> >>> OK
>>>> >> >>> dt=111
>>>> >> >>> Time taken: 0.108 seconds
>>>> >> >>> hive> alter table t1 drop partition ( dt=111 );
>>>> >> >>> FAILED: Error in semantic analysis: Partition not found dt =
>>>> >> >>> 111
>>>> >> >>> hive> alter table t1 drop partition ( dt='111' );
>>>> >> >>> FAILED: Error in semantic analysis: Partition not found dt =
> '111'
>>>> >> >>>
>>>> >> >>>
>>>> >> >>> So, how to delete the partition?
>>>> >> >>
>>>> >> >>
>>>> >> >>
>>>> >> >>
>>>> >> >>
>>>> >> >
>>>> >> >
>>>> >> >
>>>> >> > --
>>>> >> > Regards,
>>>> >> > Bhavesh Shah
>>>> >> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> > --
>>>> > "...:::Aniket:::... Quetzalco@tl"
>>>
>>>
>>>
>>>
>>> --
>>> "...:::Aniket:::... Quetzalco@tl"
>

RE: Hive partition problem

Posted by Malcolm Tye <ma...@btinternet.com>.
Hi,
	We used to use integer partitioning for 2 columns, "year_month_day"
and "hour"

When it came to dropping 1 partition for an hour for a particular day, it
seemed to drop all of the hour partitions for the day.

IMO it's a bug. We just moved to using text


Malc


-----Original Message-----
From: wd [mailto:wd@wdicc.com] 
Sent: 31 May 2012 09:32
To: user@hive.apache.org
Subject: Re: Hive partition problem

Is this a bug? Should I report a bug to hive?

On Thu, May 31, 2012 at 3:56 PM, wd <wd...@wdicc.com> wrote:
> Still no useful output. But we found the problem.
>
> When the partition col type is int, it can't be droped. After change 
> it to string, it can be droped.
>
> On Thu, May 31, 2012 at 3:48 PM, Aniket Mokashi <an...@gmail.com>
wrote:
>> -hiveconf hive.root.logger=DEBUG,FA \
>>     -hiveconf hive.log.dir="$logDir" \
>>     -hiveconf hive.log.file="$logFile" \
>>
>> On Thu, May 31, 2012 at 12:41 AM, wd <wd...@wdicc.com> wrote:
>>>
>>> Nothing output in hive history file, is there an other log file or 
>>> an option to output detail log ?
>>>
>>> On Thu, May 31, 2012 at 3:34 PM, Aniket Mokashi 
>>> <an...@gmail.com>
>>> wrote:
>>> > You should look at hive log and find exact exception. That will 
>>> > give you a hint.
>>> >
>>> >
>>> > On Thu, May 31, 2012 at 12:33 AM, wd <wd...@wdicc.com> wrote:
>>> >>
>>> >> No problem, thanks for your reply.
>>> >> I'm very curious why this didn't work, this sql come from hive wiki.
>>> >> The metadata is store in postgres, does it matter?
>>> >>
>>> >> On Thu, May 31, 2012 at 3:26 PM, Bhavesh Shah 
>>> >> <bh...@gmail.com>
>>> >> wrote:
>>> >> > Sorry for previous reply. Actually you had try that one, I 
>>> >> > didn't saw that.
>>> >> > Really Sorry.
>>> >> >
>>> >> > On Thu, May 31, 2012 at 12:53 PM, Bhavesh Shah 
>>> >> > <bh...@gmail.com>
>>> >> > wrote:
>>> >> >>
>>> >> >> Hello wd,
>>> >> >> Try this one... I am not sure about this ALTER TABLE t1 DROP 
>>> >> >> PARTITION(dt = '111')
>>> >> >>
>>> >> >>
>>> >> >> --
>>> >> >> Regards,
>>> >> >> Bhavesh Shah
>>> >> >>
>>> >> >>
>>> >> >> On Thu, May 31, 2012 at 12:49 PM, wd <wd...@wdicc.com> wrote:
>>> >> >>>
>>> >> >>> hi,
>>> >> >>>
>>> >> >>> We setup a new hive 0.9 client, Found some sql did not work, 
>>> >> >>> for example
>>> >> >>>
>>> >> >>> hive> create table t1(a int) partitioned by ( dt int );
>>> >> >>> OK
>>> >> >>> Time taken: 0.097 seconds
>>> >> >>> hive> load data local inpath '/tmp/t' into table t1 partition
>>> >> >>> (dt=111);
>>> >> >>> Copying data from file:/tmp/t Copying file: file:/tmp/t 
>>> >> >>> Loading data to table default.t1 partition (dt=111) OK Time 
>>> >> >>> taken: 0.375 seconds
>>> >> >>> hive> show partitions t1;
>>> >> >>> OK
>>> >> >>> dt=111
>>> >> >>> Time taken: 0.108 seconds
>>> >> >>> hive> alter table t1 drop partition ( dt=111 );
>>> >> >>> FAILED: Error in semantic analysis: Partition not found dt = 
>>> >> >>> 111
>>> >> >>> hive> alter table t1 drop partition ( dt='111' );
>>> >> >>> FAILED: Error in semantic analysis: Partition not found dt =
'111'
>>> >> >>>
>>> >> >>>
>>> >> >>> So, how to delete the partition?
>>> >> >>
>>> >> >>
>>> >> >>
>>> >> >>
>>> >> >>
>>> >> >
>>> >> >
>>> >> >
>>> >> > --
>>> >> > Regards,
>>> >> > Bhavesh Shah
>>> >> >
>>> >
>>> >
>>> >
>>> >
>>> > --
>>> > "...:::Aniket:::... Quetzalco@tl"
>>
>>
>>
>>
>> --
>> "...:::Aniket:::... Quetzalco@tl"


Re: Hive partition problem

Posted by wd <wd...@wdicc.com>.
Is this a bug? Should I report a bug to hive?

On Thu, May 31, 2012 at 3:56 PM, wd <wd...@wdicc.com> wrote:
> Still no useful output. But we found the problem.
>
> When the partition col type is int, it can't be droped. After change
> it to string, it can be droped.
>
> On Thu, May 31, 2012 at 3:48 PM, Aniket Mokashi <an...@gmail.com> wrote:
>> -hiveconf hive.root.logger=DEBUG,FA \
>>     -hiveconf hive.log.dir="$logDir" \
>>     -hiveconf hive.log.file="$logFile" \
>>
>> On Thu, May 31, 2012 at 12:41 AM, wd <wd...@wdicc.com> wrote:
>>>
>>> Nothing output in hive history file, is there an other log file or an
>>> option to output detail log ?
>>>
>>> On Thu, May 31, 2012 at 3:34 PM, Aniket Mokashi <an...@gmail.com>
>>> wrote:
>>> > You should look at hive log and find exact exception. That will give you
>>> > a
>>> > hint.
>>> >
>>> >
>>> > On Thu, May 31, 2012 at 12:33 AM, wd <wd...@wdicc.com> wrote:
>>> >>
>>> >> No problem, thanks for your reply.
>>> >> I'm very curious why this didn't work, this sql come from hive wiki.
>>> >> The metadata is store in postgres, does it matter?
>>> >>
>>> >> On Thu, May 31, 2012 at 3:26 PM, Bhavesh Shah <bh...@gmail.com>
>>> >> wrote:
>>> >> > Sorry for previous reply. Actually you had try that one, I didn't saw
>>> >> > that.
>>> >> > Really Sorry.
>>> >> >
>>> >> > On Thu, May 31, 2012 at 12:53 PM, Bhavesh Shah
>>> >> > <bh...@gmail.com>
>>> >> > wrote:
>>> >> >>
>>> >> >> Hello wd,
>>> >> >> Try this one... I am not sure about this
>>> >> >> ALTER TABLE t1 DROP PARTITION(dt = '111')
>>> >> >>
>>> >> >>
>>> >> >> --
>>> >> >> Regards,
>>> >> >> Bhavesh Shah
>>> >> >>
>>> >> >>
>>> >> >> On Thu, May 31, 2012 at 12:49 PM, wd <wd...@wdicc.com> wrote:
>>> >> >>>
>>> >> >>> hi,
>>> >> >>>
>>> >> >>> We setup a new hive 0.9 client, Found some sql did not work, for
>>> >> >>> example
>>> >> >>>
>>> >> >>> hive> create table t1(a int) partitioned by ( dt int );
>>> >> >>> OK
>>> >> >>> Time taken: 0.097 seconds
>>> >> >>> hive> load data local inpath '/tmp/t' into table t1 partition
>>> >> >>> (dt=111);
>>> >> >>> Copying data from file:/tmp/t
>>> >> >>> Copying file: file:/tmp/t
>>> >> >>> Loading data to table default.t1 partition (dt=111)
>>> >> >>> OK
>>> >> >>> Time taken: 0.375 seconds
>>> >> >>> hive> show partitions t1;
>>> >> >>> OK
>>> >> >>> dt=111
>>> >> >>> Time taken: 0.108 seconds
>>> >> >>> hive> alter table t1 drop partition ( dt=111 );
>>> >> >>> FAILED: Error in semantic analysis: Partition not found dt = 111
>>> >> >>> hive> alter table t1 drop partition ( dt='111' );
>>> >> >>> FAILED: Error in semantic analysis: Partition not found dt = '111'
>>> >> >>>
>>> >> >>>
>>> >> >>> So, how to delete the partition?
>>> >> >>
>>> >> >>
>>> >> >>
>>> >> >>
>>> >> >>
>>> >> >
>>> >> >
>>> >> >
>>> >> > --
>>> >> > Regards,
>>> >> > Bhavesh Shah
>>> >> >
>>> >
>>> >
>>> >
>>> >
>>> > --
>>> > "...:::Aniket:::... Quetzalco@tl"
>>
>>
>>
>>
>> --
>> "...:::Aniket:::... Quetzalco@tl"

Re: Hive partition problem

Posted by wd <wd...@wdicc.com>.
Still no useful output. But we found the problem.

When the partition col type is int, it can't be droped. After change
it to string, it can be droped.

On Thu, May 31, 2012 at 3:48 PM, Aniket Mokashi <an...@gmail.com> wrote:
> -hiveconf hive.root.logger=DEBUG,FA \
>     -hiveconf hive.log.dir="$logDir" \
>     -hiveconf hive.log.file="$logFile" \
>
> On Thu, May 31, 2012 at 12:41 AM, wd <wd...@wdicc.com> wrote:
>>
>> Nothing output in hive history file, is there an other log file or an
>> option to output detail log ?
>>
>> On Thu, May 31, 2012 at 3:34 PM, Aniket Mokashi <an...@gmail.com>
>> wrote:
>> > You should look at hive log and find exact exception. That will give you
>> > a
>> > hint.
>> >
>> >
>> > On Thu, May 31, 2012 at 12:33 AM, wd <wd...@wdicc.com> wrote:
>> >>
>> >> No problem, thanks for your reply.
>> >> I'm very curious why this didn't work, this sql come from hive wiki.
>> >> The metadata is store in postgres, does it matter?
>> >>
>> >> On Thu, May 31, 2012 at 3:26 PM, Bhavesh Shah <bh...@gmail.com>
>> >> wrote:
>> >> > Sorry for previous reply. Actually you had try that one, I didn't saw
>> >> > that.
>> >> > Really Sorry.
>> >> >
>> >> > On Thu, May 31, 2012 at 12:53 PM, Bhavesh Shah
>> >> > <bh...@gmail.com>
>> >> > wrote:
>> >> >>
>> >> >> Hello wd,
>> >> >> Try this one... I am not sure about this
>> >> >> ALTER TABLE t1 DROP PARTITION(dt = '111')
>> >> >>
>> >> >>
>> >> >> --
>> >> >> Regards,
>> >> >> Bhavesh Shah
>> >> >>
>> >> >>
>> >> >> On Thu, May 31, 2012 at 12:49 PM, wd <wd...@wdicc.com> wrote:
>> >> >>>
>> >> >>> hi,
>> >> >>>
>> >> >>> We setup a new hive 0.9 client, Found some sql did not work, for
>> >> >>> example
>> >> >>>
>> >> >>> hive> create table t1(a int) partitioned by ( dt int );
>> >> >>> OK
>> >> >>> Time taken: 0.097 seconds
>> >> >>> hive> load data local inpath '/tmp/t' into table t1 partition
>> >> >>> (dt=111);
>> >> >>> Copying data from file:/tmp/t
>> >> >>> Copying file: file:/tmp/t
>> >> >>> Loading data to table default.t1 partition (dt=111)
>> >> >>> OK
>> >> >>> Time taken: 0.375 seconds
>> >> >>> hive> show partitions t1;
>> >> >>> OK
>> >> >>> dt=111
>> >> >>> Time taken: 0.108 seconds
>> >> >>> hive> alter table t1 drop partition ( dt=111 );
>> >> >>> FAILED: Error in semantic analysis: Partition not found dt = 111
>> >> >>> hive> alter table t1 drop partition ( dt='111' );
>> >> >>> FAILED: Error in semantic analysis: Partition not found dt = '111'
>> >> >>>
>> >> >>>
>> >> >>> So, how to delete the partition?
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Regards,
>> >> > Bhavesh Shah
>> >> >
>> >
>> >
>> >
>> >
>> > --
>> > "...:::Aniket:::... Quetzalco@tl"
>
>
>
>
> --
> "...:::Aniket:::... Quetzalco@tl"

Re: Hive partition problem

Posted by Aniket Mokashi <an...@gmail.com>.
-hiveconf hive.root.logger=DEBUG,FA \
    -hiveconf hive.log.dir="$logDir" \
    -hiveconf hive.log.file="$logFile" \

On Thu, May 31, 2012 at 12:41 AM, wd <wd...@wdicc.com> wrote:

> Nothing output in hive history file, is there an other log file or an
> option to output detail log ?
>
> On Thu, May 31, 2012 at 3:34 PM, Aniket Mokashi <an...@gmail.com>
> wrote:
> > You should look at hive log and find exact exception. That will give you
> a
> > hint.
> >
> >
> > On Thu, May 31, 2012 at 12:33 AM, wd <wd...@wdicc.com> wrote:
> >>
> >> No problem, thanks for your reply.
> >> I'm very curious why this didn't work, this sql come from hive wiki.
> >> The metadata is store in postgres, does it matter?
> >>
> >> On Thu, May 31, 2012 at 3:26 PM, Bhavesh Shah <bh...@gmail.com>
> >> wrote:
> >> > Sorry for previous reply. Actually you had try that one, I didn't saw
> >> > that.
> >> > Really Sorry.
> >> >
> >> > On Thu, May 31, 2012 at 12:53 PM, Bhavesh Shah <
> bhavesh25shah@gmail.com>
> >> > wrote:
> >> >>
> >> >> Hello wd,
> >> >> Try this one... I am not sure about this
> >> >> ALTER TABLE t1 DROP PARTITION(dt = '111')
> >> >>
> >> >>
> >> >> --
> >> >> Regards,
> >> >> Bhavesh Shah
> >> >>
> >> >>
> >> >> On Thu, May 31, 2012 at 12:49 PM, wd <wd...@wdicc.com> wrote:
> >> >>>
> >> >>> hi,
> >> >>>
> >> >>> We setup a new hive 0.9 client, Found some sql did not work, for
> >> >>> example
> >> >>>
> >> >>> hive> create table t1(a int) partitioned by ( dt int );
> >> >>> OK
> >> >>> Time taken: 0.097 seconds
> >> >>> hive> load data local inpath '/tmp/t' into table t1 partition
> >> >>> (dt=111);
> >> >>> Copying data from file:/tmp/t
> >> >>> Copying file: file:/tmp/t
> >> >>> Loading data to table default.t1 partition (dt=111)
> >> >>> OK
> >> >>> Time taken: 0.375 seconds
> >> >>> hive> show partitions t1;
> >> >>> OK
> >> >>> dt=111
> >> >>> Time taken: 0.108 seconds
> >> >>> hive> alter table t1 drop partition ( dt=111 );
> >> >>> FAILED: Error in semantic analysis: Partition not found dt = 111
> >> >>> hive> alter table t1 drop partition ( dt='111' );
> >> >>> FAILED: Error in semantic analysis: Partition not found dt = '111'
> >> >>>
> >> >>>
> >> >>> So, how to delete the partition?
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > Regards,
> >> > Bhavesh Shah
> >> >
> >
> >
> >
> >
> > --
> > "...:::Aniket:::... Quetzalco@tl"
>



-- 
"...:::Aniket:::... Quetzalco@tl"

Re: Hive partition problem

Posted by wd <wd...@wdicc.com>.
Nothing output in hive history file, is there an other log file or an
option to output detail log ?

On Thu, May 31, 2012 at 3:34 PM, Aniket Mokashi <an...@gmail.com> wrote:
> You should look at hive log and find exact exception. That will give you a
> hint.
>
>
> On Thu, May 31, 2012 at 12:33 AM, wd <wd...@wdicc.com> wrote:
>>
>> No problem, thanks for your reply.
>> I'm very curious why this didn't work, this sql come from hive wiki.
>> The metadata is store in postgres, does it matter?
>>
>> On Thu, May 31, 2012 at 3:26 PM, Bhavesh Shah <bh...@gmail.com>
>> wrote:
>> > Sorry for previous reply. Actually you had try that one, I didn't saw
>> > that.
>> > Really Sorry.
>> >
>> > On Thu, May 31, 2012 at 12:53 PM, Bhavesh Shah <bh...@gmail.com>
>> > wrote:
>> >>
>> >> Hello wd,
>> >> Try this one... I am not sure about this
>> >> ALTER TABLE t1 DROP PARTITION(dt = '111')
>> >>
>> >>
>> >> --
>> >> Regards,
>> >> Bhavesh Shah
>> >>
>> >>
>> >> On Thu, May 31, 2012 at 12:49 PM, wd <wd...@wdicc.com> wrote:
>> >>>
>> >>> hi,
>> >>>
>> >>> We setup a new hive 0.9 client, Found some sql did not work, for
>> >>> example
>> >>>
>> >>> hive> create table t1(a int) partitioned by ( dt int );
>> >>> OK
>> >>> Time taken: 0.097 seconds
>> >>> hive> load data local inpath '/tmp/t' into table t1 partition
>> >>> (dt=111);
>> >>> Copying data from file:/tmp/t
>> >>> Copying file: file:/tmp/t
>> >>> Loading data to table default.t1 partition (dt=111)
>> >>> OK
>> >>> Time taken: 0.375 seconds
>> >>> hive> show partitions t1;
>> >>> OK
>> >>> dt=111
>> >>> Time taken: 0.108 seconds
>> >>> hive> alter table t1 drop partition ( dt=111 );
>> >>> FAILED: Error in semantic analysis: Partition not found dt = 111
>> >>> hive> alter table t1 drop partition ( dt='111' );
>> >>> FAILED: Error in semantic analysis: Partition not found dt = '111'
>> >>>
>> >>>
>> >>> So, how to delete the partition?
>> >>
>> >>
>> >>
>> >>
>> >>
>> >
>> >
>> >
>> > --
>> > Regards,
>> > Bhavesh Shah
>> >
>
>
>
>
> --
> "...:::Aniket:::... Quetzalco@tl"

Re: Hive partition problem

Posted by Aniket Mokashi <an...@gmail.com>.
You should look at hive log and find exact exception. That will give you a
hint.

On Thu, May 31, 2012 at 12:33 AM, wd <wd...@wdicc.com> wrote:

> No problem, thanks for your reply.
> I'm very curious why this didn't work, this sql come from hive wiki.
> The metadata is store in postgres, does it matter?
>
> On Thu, May 31, 2012 at 3:26 PM, Bhavesh Shah <bh...@gmail.com>
> wrote:
> > Sorry for previous reply. Actually you had try that one, I didn't saw
> that.
> > Really Sorry.
> >
> > On Thu, May 31, 2012 at 12:53 PM, Bhavesh Shah <bh...@gmail.com>
> > wrote:
> >>
> >> Hello wd,
> >> Try this one... I am not sure about this
> >> ALTER TABLE t1 DROP PARTITION(dt = '111')
> >>
> >>
> >> --
> >> Regards,
> >> Bhavesh Shah
> >>
> >>
> >> On Thu, May 31, 2012 at 12:49 PM, wd <wd...@wdicc.com> wrote:
> >>>
> >>> hi,
> >>>
> >>> We setup a new hive 0.9 client, Found some sql did not work, for
> example
> >>>
> >>> hive> create table t1(a int) partitioned by ( dt int );
> >>> OK
> >>> Time taken: 0.097 seconds
> >>> hive> load data local inpath '/tmp/t' into table t1 partition (dt=111);
> >>> Copying data from file:/tmp/t
> >>> Copying file: file:/tmp/t
> >>> Loading data to table default.t1 partition (dt=111)
> >>> OK
> >>> Time taken: 0.375 seconds
> >>> hive> show partitions t1;
> >>> OK
> >>> dt=111
> >>> Time taken: 0.108 seconds
> >>> hive> alter table t1 drop partition ( dt=111 );
> >>> FAILED: Error in semantic analysis: Partition not found dt = 111
> >>> hive> alter table t1 drop partition ( dt='111' );
> >>> FAILED: Error in semantic analysis: Partition not found dt = '111'
> >>>
> >>>
> >>> So, how to delete the partition?
> >>
> >>
> >>
> >>
> >>
> >
> >
> >
> > --
> > Regards,
> > Bhavesh Shah
> >
>



-- 
"...:::Aniket:::... Quetzalco@tl"

Re: Hive partition problem

Posted by wd <wd...@wdicc.com>.
No problem, thanks for your reply.
I'm very curious why this didn't work, this sql come from hive wiki.
The metadata is store in postgres, does it matter?

On Thu, May 31, 2012 at 3:26 PM, Bhavesh Shah <bh...@gmail.com> wrote:
> Sorry for previous reply. Actually you had try that one, I didn't saw that.
> Really Sorry.
>
> On Thu, May 31, 2012 at 12:53 PM, Bhavesh Shah <bh...@gmail.com>
> wrote:
>>
>> Hello wd,
>> Try this one... I am not sure about this
>> ALTER TABLE t1 DROP PARTITION(dt = '111')
>>
>>
>> --
>> Regards,
>> Bhavesh Shah
>>
>>
>> On Thu, May 31, 2012 at 12:49 PM, wd <wd...@wdicc.com> wrote:
>>>
>>> hi,
>>>
>>> We setup a new hive 0.9 client, Found some sql did not work, for example
>>>
>>> hive> create table t1(a int) partitioned by ( dt int );
>>> OK
>>> Time taken: 0.097 seconds
>>> hive> load data local inpath '/tmp/t' into table t1 partition (dt=111);
>>> Copying data from file:/tmp/t
>>> Copying file: file:/tmp/t
>>> Loading data to table default.t1 partition (dt=111)
>>> OK
>>> Time taken: 0.375 seconds
>>> hive> show partitions t1;
>>> OK
>>> dt=111
>>> Time taken: 0.108 seconds
>>> hive> alter table t1 drop partition ( dt=111 );
>>> FAILED: Error in semantic analysis: Partition not found dt = 111
>>> hive> alter table t1 drop partition ( dt='111' );
>>> FAILED: Error in semantic analysis: Partition not found dt = '111'
>>>
>>>
>>> So, how to delete the partition?
>>
>>
>>
>>
>>
>
>
>
> --
> Regards,
> Bhavesh Shah
>

Re: Hive partition problem

Posted by Bhavesh Shah <bh...@gmail.com>.
Sorry for previous reply. Actually you had try that one, I didn't saw that.
Really Sorry.

On Thu, May 31, 2012 at 12:53 PM, Bhavesh Shah <bh...@gmail.com>wrote:

> Hello wd,
> Try this one... I am not sure about this
> ALTER TABLE t1 DROP PARTITION(dt = '111')
>
>
> --
> Regards,
> Bhavesh Shah
>
>
> On Thu, May 31, 2012 at 12:49 PM, wd <wd...@wdicc.com> wrote:
>
>> hi,
>>
>> We setup a new hive 0.9 client, Found some sql did not work, for example
>>
>> hive> create table t1(a int) partitioned by ( dt int );
>> OK
>> Time taken: 0.097 seconds
>> hive> load data local inpath '/tmp/t' into table t1 partition (dt=111);
>> Copying data from file:/tmp/t
>> Copying file: file:/tmp/t
>> Loading data to table default.t1 partition (dt=111)
>> OK
>> Time taken: 0.375 seconds
>> hive> show partitions t1;
>> OK
>> dt=111
>> Time taken: 0.108 seconds
>> hive> alter table t1 drop partition ( dt=111 );
>> FAILED: Error in semantic analysis: Partition not found dt = 111
>> hive> alter table t1 drop partition ( dt='111' );
>> FAILED: Error in semantic analysis: Partition not found dt = '111'
>>
>>
>> So, how to delete the partition?
>>
>
>
>
>
>


-- 
Regards,
Bhavesh Shah

Re: Hive partition problem

Posted by Bhavesh Shah <bh...@gmail.com>.
Hello wd,
Try this one... I am not sure about this
ALTER TABLE t1 DROP PARTITION(dt = '111')


-- 
Regards,
Bhavesh Shah


On Thu, May 31, 2012 at 12:49 PM, wd <wd...@wdicc.com> wrote:

> hi,
>
> We setup a new hive 0.9 client, Found some sql did not work, for example
>
> hive> create table t1(a int) partitioned by ( dt int );
> OK
> Time taken: 0.097 seconds
> hive> load data local inpath '/tmp/t' into table t1 partition (dt=111);
> Copying data from file:/tmp/t
> Copying file: file:/tmp/t
> Loading data to table default.t1 partition (dt=111)
> OK
> Time taken: 0.375 seconds
> hive> show partitions t1;
> OK
> dt=111
> Time taken: 0.108 seconds
> hive> alter table t1 drop partition ( dt=111 );
> FAILED: Error in semantic analysis: Partition not found dt = 111
> hive> alter table t1 drop partition ( dt='111' );
> FAILED: Error in semantic analysis: Partition not found dt = '111'
>
>
> So, how to delete the partition?
>