You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Laurent Vaills <la...@gmail.com> on 2011/10/26 22:14:19 UTC

External table over a SequenceFile

Hi,

I have a mapred that ends with an IntSumReducer that produces a
SequenceFile<TextFormat, IntWritable> .

I tried to create an external table over the sequence files with the
following statement is :
CREATE EXTERNAL TABLE IF NOT EXISTS foo(key string, value int) STORED AS
SEQUENCE FILE LOCATION '/tmp/output' ;
 but I get this error :
Failed with exception
java.io.IOException:org.apache.hadoop.hive.serde2.SerDeException: class
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe: expects either
BytesWritable or Text object!

The sequence file is valid : I can read it with Pig ou "hadoop fs -text" .

Does anyone has the correct syntax to create the external table ?

Regards,
Laurent

RE: External table over a SequenceFile

Posted by Steven Wong <sw...@netflix.com>.
By default, Hive tables use LazySimpleSerDe, which requires that all the columns be stuffed into the sequence file's value, separated by delimiters.


From: Laurent Vaills [mailto:laurent.vaills@gmail.com]
Sent: Wednesday, October 26, 2011 1:14 PM
To: user@hive.apache.org
Subject: External table over a SequenceFile

Hi,

I have a mapred that ends with an IntSumReducer that produces a SequenceFile<TextFormat, IntWritable> .

I tried to create an external table over the sequence files with the following statement is :
CREATE EXTERNAL TABLE IF NOT EXISTS foo(key string, value int) STORED AS SEQUENCE FILE LOCATION '/tmp/output' ;
 but I get this error :
Failed with exception java.io.IOException:org.apache.hadoop.hive.serde2.SerDeException: class org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe: expects either BytesWritable or Text object!

The sequence file is valid : I can read it with Pig ou "hadoop fs -text" .

Does anyone has the correct syntax to create the external table ?

Regards,
Laurent