You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by He Yongqiang <he...@software.ict.ac.cn> on 2009/07/09 15:13:47 UTC
Query when partition presents.
Hi all,
The situation:
create table srcpart(key string, value string) partitioned by (ds string, hr
int);
load data local inpath
\"/Users/char/Documents/workspace/Hive-Clean/data/files/kv1.txt\" overwrite
into table srcpart PARTITION (ds='2008-04-08', hr=11);
load data local inpath
\"/Users/char/Documents/workspace/Hive-Clean/data/files/kv1.txt\" into table
srcpart ;
And the command select * from srcpart¹ only access the partition data? And
the data outside any partition is left untouched?
Yongqiang
Re: Query when partition presents.
Posted by Namit Jain <nj...@facebook.com>.
Merged that just now
On 7/9/09 7:57 AM, "He Yongqiang" <he...@software.ict.ac.cn> wrote:
Hi Namit,
I found the jira issue https://issues.apache.org/jira/browse/HIVE-527.
On 09-7-9 下午10:17, "Namit Jain" <nj...@facebook.com> wrote:
If a table is partitioned, we should only allow insertion/loading data in a partition – not the table.
So, load data local inpath \"/Users/char/Documents/workspace/Hive-Clean/data/files/kv1.txt\" into table srcpart ;
should fail.
I think there was already a jira for that – let me check and otherwise file one.
Thanks,
-namit
On 7/9/09 6:13 AM, "He Yongqiang" <he...@software.ict.ac.cn> wrote:
Hi all,
The situation:
create table srcpart(key string, value string) partitioned by (ds string, hr int);
load data local inpath \"/Users/char/Documents/workspace/Hive-Clean/data/files/kv1.txt\" overwrite into table srcpart PARTITION (ds='2008-04-08', hr=11);
load data local inpath \"/Users/char/Documents/workspace/Hive-Clean/data/files/kv1.txt\" into table srcpart ;
And the command ‘select * from srcpart’ only access the partition data? And the data outside any partition is left untouched?
Yongqiang
Re: Query when partition presents.
Posted by He Yongqiang <he...@software.ict.ac.cn>.
Hi Namit,
I found the jira issue https://issues.apache.org/jira/browse/HIVE-527.
On 09-7-9 下午10:17, "Namit Jain" <nj...@facebook.com> wrote:
> If a table is partitioned, we should only allow insertion/loading data in a
> partition – not the table.
> So, load data local inpath
> \"/Users/char/Documents/workspace/Hive-Clean/data/files/kv1.txt\" into table
> srcpart ;
> should fail.
>
> I think there was already a jira for that – let me check and otherwise file
> one.
>
>
> Thanks,
> -namit
>
>
> On 7/9/09 6:13 AM, "He Yongqiang" <he...@software.ict.ac.cn> wrote:
>
>> Hi all,
>> The situation:
>> create table srcpart(key string, value string) partitioned by (ds string, hr
>> int);
>> load data local inpath
>> \"/Users/char/Documents/workspace/Hive-Clean/data/files/kv1.txt\" overwrite
>> into table srcpart PARTITION (ds='2008-04-08', hr=11);
>> load data local inpath
>> \"/Users/char/Documents/workspace/Hive-Clean/data/files/kv1.txt\" into table
>> srcpart ;
>>
>> And the command ‘select * from srcpart’ only access the partition data? And
>> the data outside any partition is left untouched?
>>
>>
>> Yongqiang
>
Re: Query when partition presents.
Posted by He Yongqiang <he...@software.ict.ac.cn>.
Thanks, my index work for partition is more clear now.
I can just create a set of partitions for index table as the same as the
original table.
And add index data to corresponding partitions.
On 09-7-9 下午10:17, "Namit Jain" <nj...@facebook.com> wrote:
> If a table is partitioned, we should only allow insertion/loading data in a
> partition – not the table.
> So, load data local inpath
> \"/Users/char/Documents/workspace/Hive-Clean/data/files/kv1.txt\" into table
> srcpart ;
> should fail.
>
> I think there was already a jira for that – let me check and otherwise file
> one.
>
>
> Thanks,
> -namit
>
>
> On 7/9/09 6:13 AM, "He Yongqiang" <he...@software.ict.ac.cn> wrote:
>
>> Hi all,
>> The situation:
>> create table srcpart(key string, value string) partitioned by (ds string, hr
>> int);
>> load data local inpath
>> \"/Users/char/Documents/workspace/Hive-Clean/data/files/kv1.txt\" overwrite
>> into table srcpart PARTITION (ds='2008-04-08', hr=11);
>> load data local inpath
>> \"/Users/char/Documents/workspace/Hive-Clean/data/files/kv1.txt\" into table
>> srcpart ;
>>
>> And the command ‘select * from srcpart’ only access the partition data? And
>> the data outside any partition is left untouched?
>>
>>
>> Yongqiang
>
Re: Query when partition presents.
Posted by Namit Jain <nj...@facebook.com>.
If a table is partitioned, we should only allow insertion/loading data in a partition - not the table.
So, load data local inpath \"/Users/char/Documents/workspace/Hive-Clean/data/files/kv1.txt\" into table srcpart ;
should fail.
I think there was already a jira for that - let me check and otherwise file one.
Thanks,
-namit
On 7/9/09 6:13 AM, "He Yongqiang" <he...@software.ict.ac.cn> wrote:
Hi all,
The situation:
create table srcpart(key string, value string) partitioned by (ds string, hr int);
load data local inpath \"/Users/char/Documents/workspace/Hive-Clean/data/files/kv1.txt\" overwrite into table srcpart PARTITION (ds='2008-04-08', hr=11);
load data local inpath \"/Users/char/Documents/workspace/Hive-Clean/data/files/kv1.txt\" into table srcpart ;
And the command 'select * from srcpart' only access the partition data? And the data outside any partition is left untouched?
Yongqiang