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.