|
|
-
how to split the value of hbase into hive
ylyy-1985 2012-04-18, 07:36
hi,all;
I have a problem. I have an hbase table, with key-value pair like "user1001:12,1223,string". And now how can I split the value into three fields "ID,phone,and memo" and then insert into hive table? does hive support this?
thanks
2012-04-18
Andes
+
ylyy-1985 2012-04-18, 07:36
-
Re: how to split the value of hbase into hive
Nitin Pawar 2012-04-18, 07:42
you can use the inbuilt udf split(string str, string pat) to split the string with the separator you want. It returns the array and you can access the array and insert array elements in the hive table
On Wed, Apr 18, 2012 at 1:06 PM, ylyy-1985 <[EMAIL PROTECTED]> wrote:
> ** > ** > hi,all; > > I have a problem. I have an hbase table, with key-value pair like > "user1001:12,1223,string". And now how can I split the value into three > fields "ID,phone,and memo" and then insert into hive table? does hive > support this? > > thanks > > 2012-04-18 > ------------------------------ > Andes > ** >
-- Nitin Pawar
+
Nitin Pawar 2012-04-18, 07:42
-
回复: Re: how to split the value of hbase into hive
ylyy-1985 2012-04-18, 08:16
hi,Nitin and other friends:
I see the UDF function is suited for me, but I don't really understand how to use it. Right now, I have put a record into Hbase, and scan it:
hbase(main):015:0> scan 'table_wyl' ROW COLUMN+CELL r1 column=key:value, timestamp=1334765068428, value=010,020,030
then how can I get the array in hive? and insert it into a hive table? 2012-04-18
Best Regards Andes 发件人:Nitin Pawar 发送时间:2012-04-18 15:43 主题:Re: how to split the value of hbase into hive 收件人:"user"<[EMAIL PROTECTED]> 抄送:
you can use the inbuilt udf split(string str, string pat) to split the string with the separator you want. It returns the array and you can access the array and insert array elements in the hive table On Wed, Apr 18, 2012 at 1:06 PM, ylyy-1985 <[EMAIL PROTECTED]> wrote:
hi,all;
I have a problem. I have an hbase table, with key-value pair like "user1001:12,1223,string". And now how can I split the value into three fields "ID,phone,and memo" and then insert into hive table? does hive support this?
thanks
2012-04-18
Andes
-- Nitin Pawar
+
ylyy-1985 2012-04-18, 08:16
-
Re: Re: how to split the value of hbase into hive
Nitin Pawar 2012-04-18, 08:25
you can checkout hive trunk and do a build it has implementation of accessing hbase tables directly through hive with HBaseStorageHandler.
That will solve plenty of other problems which you might face during getting data from hbase to hive tables
You can search on hive mailing lists. Vishal had solved this problem already in another mail thread with topic "Hive query on existing HBase table" On Wed, Apr 18, 2012 at 1:46 PM, ylyy-1985 <[EMAIL PROTECTED]> wrote:
> ** > hi,Nitin and other friends: > > I see the UDF function is suited for me, but I don't really understand > how to use it. Right now, I have put a record into Hbase, and scan it: > > hbase(main):015:0> scan 'table_wyl' > ROW COLUMN+CELL > r1 column=key:value, timestamp=1334765068428, > value=010,020,030 > > then how can I get the array in hive? and insert it into a hive table? > 2012-04-18 > ------------------------------ > ** > Best Regards > Andes > > ** > ------------------------------ > *发件人:*Nitin Pawar > *发送时间:*2012-04-18 15:43 > *主题:*Re: how to split the value of hbase into hive > *收件人:*"user"<[EMAIL PROTECTED]> > *抄送:* > > you can use the inbuilt udf split(string str, string pat) to split the > string with the separator you want. It returns the array and you can access > the array and insert array elements in the hive table > > On Wed, Apr 18, 2012 at 1:06 PM, ylyy-1985 <[EMAIL PROTECTED]> wrote: > >> ** >> ** >> hi,all; >> >> I have a problem. I have an hbase table, with key-value pair like >> "user1001:12,1223,string". And now how can I split the value into three >> fields "ID,phone,and memo" and then insert into hive table? does hive >> support this? >> >> thanks >> >> 2012-04-18 >> ------------------------------ >> Andes >> ** >> > > > > -- > Nitin Pawar > > -- Nitin Pawar
+
Nitin Pawar 2012-04-18, 08:25
-
回复: Re: how to split the value of hbase into hive
ylyy-1985 2012-04-18, 07:48
thanks Nitin. :) You are so nice. I will try this first. if I meet with problems later, pls be kind to help
2012-04-18
Best Regards Andes 发件人:Nitin Pawar 发送时间:2012-04-18 15:43 主题:Re: how to split the value of hbase into hive 收件人:"user"<[EMAIL PROTECTED]> 抄送:
you can use the inbuilt udf split(string str, string pat) to split the string with the separator you want. It returns the array and you can access the array and insert array elements in the hive table On Wed, Apr 18, 2012 at 1:06 PM, ylyy-1985 <[EMAIL PROTECTED]> wrote:
hi,all;
I have a problem. I have an hbase table, with key-value pair like "user1001:12,1223,string". And now how can I split the value into three fields "ID,phone,and memo" and then insert into hive table? does hive support this?
thanks
2012-04-18
Andes
-- Nitin Pawar
+
ylyy-1985 2012-04-18, 07:48
|
|