Zheng Shao wrote:
WITH SERDEPROPERTIES ('input.regex'='(\\w+) (\\w+) (\\w+)
(\\w+)\\t(\\w+) (\\w+) (\\w+)')
The reason for double backslash is that Hive string constant will take
one level of escaping, and the regular expression will take another level.
Please let us know where you see the 'regex'='...' syntax. It's
outdated. We need to update it.
I really wish I had just made all the columns tab separated =/
Thanks for the regexp, it now correctly parses the file.
Question, RegexSerDe only works with string columns so I had to use
strings for my columns
even though they are all numbers. What are the implications of this? Is
there a performance
Also I notice that the file used to load the table in HDFS no longer
exists after I issue the
LOAD DATA INPATH command. Is this expected? Is there some way to get
On Wed, Sep 9, 2009 at 9:15 PM, Mayuran Yogarajah
I have a file in HDFS which has the following format:
where cX represents column X.
Can someone please show me how I can create a table in Hive for this?
I tried the following but it gave an error:
CREATE TABLE test (
c7 STRING )
ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.RegexSerDe'
WITH SERDEPROPERTIES ('regex'='(\w+) (\w+) (\w+) (\w+)\t(\w+)
STORED AS TEXTFILE;
hive> load data inpath '/user/hadoop/test' into table test;
hive> select * from test;
Failed with exception
This table does not have serde property "input.regex"!
Thank you very much =)