Hi sir,
sadly Sqoop imported SequenceFiles can't be directly consumed by Hive. Sqoop 
generates it's own writable whereas (I believe that) Hive is expecting class 
Text. I would suggest switching to Avro format - whereas Sqoop can't import 
avro files directly into Hive yet, imported files are at least consumable by 
Hive.

Jarcec

On Tue, Mar 04, 2014 at 10:45:20AM -0800, Something Something wrote:
> Here's how I ran into this issue:
> 
> 1) Created a SequenceFile by exporting data from Oracle using Sqoop.
> 2) Used 'sqoop codegen' to generate a Hive table script.
> 3) Created table under Hive using this script.
> 4) Under Hive, ran following command:
> 
> set
> hive.aux.jars.path=/path/to/QueryResult.jar,/path/to/sqoop-1.4.4-mapr.jar
> 
> 5) select count(*) from mytable;
> 
> Got 'QueryResult cannot be cast to
> org.apache.hadoop.io.WritableComparable'. When I looked at the generated
> source, it indeed does not implement this interface. I think it should.
> 
> I guess the workaround is to implement the 'compare' method in this
> interface. But shouldn't the code generation generate this in QueryResult?
> 
> Sounds like a bug to me -:) Either that or I am doing something really
> stupid - which is always a possibility. Please share thoughts. Thanks.

Attachment: signature.asc
Description: Digital signature

Reply via email to