hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raj Hadoop <hadoop...@yahoo.com>
Subject Re: Hive external table partitions with less than symbol ?
Date Mon, 04 Nov 2013 22:42:56 GMT
Hi -

I have this doubt.

Why do i need to use an INSERT INTO .....

can I just create hdfs directories and map it to a hive external table setting the location
of the hdfs directories.

will this work ? please advise.

Thanks,
Raj







On Monday, November 4, 2013 8:34 AM, Matouk IFTISSEN <matouk.iftissen@ysance.com> wrote:
 
Yes it is possible:
hadoop fs -mkdir /hdfs_path/'cust_id>1000'

I tested it and works, then you can store data in this directory .

for concat function you do simple:

insert into your_table_partionned PARTITION (path_xxx)
select attr,id,  concat ('/data1/customer/', id) as path_xxx  from your_table
where  id <1000
......


Cdt.





2013/11/4 Raj Hadoop <hadoopraj@yahoo.com>

How can i use concat function? I did not get it. Can you please elaborate. 
>
>
>My requirement is to create a HDFS directory like 
>(cust_id>1000 and cust_id<2000)
>
>
>
>and map this to a Hive External table.
>
>
>can i do that?
>
>
>
>On Monday, November 4, 2013 3:34 AM, Matouk IFTISSEN <matouk.iftissen@ysance.com>
wrote:
> 
>Hello
>You can use concat function or case to do this like:
>Concat ('/data1/customer/', id) 
>.....
>Where id <1000 
>Etc..
>Hope this help you ;)
>Le 3 nov. 2013 23:51, "Raj Hadoop" <hadoopraj@yahoo.com> a écrit :
>
>All,
>>
>>
>>I want to create partitions like the below and create a hive external table. How can
i do that ?
>>
>>
>>/data1/customer/id<1000
>>/data1/customer/id>1000 and id < 2000
>>
>>/data1/customer/id >2000
>>
>>
>>
>>Is this possible ( < and > symbols in folders ?)
>>
>>
>>My requirement is to partition the hive table based on some customer id's.
>>
>>
>>Thanks,
>>Raj
>
>


-- 

Matouk IFTISSEN | Consultant BI & Big Data
 
24 rue du sentier - 75002 Paris - www.ysance.com
Mob : +33 6 78 51 18 69 || Fax : +33 1 73 72 97 26 
Ysance sur :Twitter | Facebook | Google+ | LinkedIn | Newsletter
Nos autres sites : ys4you | labdecisionnel | decrypt
Mime
View raw message