FAQ
I have a file in HDFS which has the following format:
c1<space>c2<space>c3<space>c4<tab>c5<space>c6<space>c7

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 (
c1 STRING,
c2 STRING,
c3 STRING,
c4 STRING,
c5 STRING,
c6 STRING,
c7 STRING )
ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.RegexSerDe'
WITH SERDEPROPERTIES ('regex'='(\w+) (\w+) (\w+) (\w+)\t(\w+) (\w+) (\w+)')
STORED AS TEXTFILE;

hive> load data inpath '/user/hadoop/test' into table test;

hive> select * from test;
OK
Failed with exception
java.io.IOException:org.apache.hadoop.hive.serde2.SerDeException: This
table does not have serde property "input.regex"!

Thank you very much =)

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 6 | next ›
Discussion Overview
groupuser @
categorieshive, hadoop
postedSep 10, '09 at 4:15a
activeSep 11, '09 at 4:10a
posts6
users2
websitehive.apache.org

2 users in discussion

Zheng Shao: 3 posts Mayuran Yogarajah: 3 posts

People

Translate

site design / logo © 2021 Grokbase