hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tucker, Matt" <Matt.Tuc...@disney.com>
Subject RE: to change hive delimiter->'||'
Date Fri, 13 Apr 2012 13:30:00 GMT
Iā€™m not sure how multiple-character delimiters work with Hive, but you might try escaping
each pipe (ā€œ\|\|ā€).  I had a similar issue with using pipes in str_to_map().
Matt Tucker
From: ylyy-1985 [mailto:ylyy-1985@163.com]
Sent: Friday, April 13, 2012 9:24 AM
To: hive_user
Subject: to change hive delimiter->'||'

hi, all. I see something strange. the defaule delimiter is \001 and I want to change to '||'.
So I just run my command :

CREATE TABLE table1(
channelid INT,serviceno STRING,regid STRING,pageurl STRING,urlext STRING,pagetitle STRING)
ROW FORMAT DELIMITED FIELDS TERMINATED BY '||' stored as textfile;

then I load the txt data(with one record="12||12003||2131||44123||22222||112") into the table,
select * from the table, I see that the 6 fields are filled with

"12","","12003","","2131",""

I think the empty value is "\t",which replace the "||", am I right? I think there is some
other ways to replace the delimiter and make hive work fine(of cause we can overwrite the
inputformat class).


2012-04-13
________________________________
Best Regards
Andes

Email:ylyy-1985@163.com<mailto:ylyy-1985@163.com>
Mime
View raw message