title: Hive: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.ClassCastException
body: <p>I have a Parquet file (created by Drill) that I'm trying to read in Hive as an external table. The data types are copied one-to-one (i.e. INTEGER -> INT, BIGINT -> BIGINT, DOUBLE -> DOUBLE, TIMESTAMP -> TIMESTAMP, CHARACTER VARYING -> STRING). There are no complex types.</p>
  
  <p>Drill has no problem querying the file it created, but Hive does not like it:</p>
  
  <pre><code>CREATE EXTERNAL TABLE my_table
  (
    &lt;col&gt; &lt;data_type&gt;
  )
  STORED AS PARQUET
  LOCATION '&lt;hdfs_location&gt;';
  </code></pre>
  
  <p>I can execute <code>SELECT COUNT(*) FROM my_table</code> and get the correct number of rows back, but when I ask for the first row it says:</p>
  
  <pre><code>Error: java.io.IOException: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.ClassCastException: org.apache.hadoop.io.IntWritable cannot be cast to org.apache.hadoop.io.LongWritable (state=,code=0)
  </code></pre>
  
  <p>I'm not sure why it complains because I use integers and big integers, none of which I assume are stored as longs. Moreover, I would assume that an integer can be cast to a long. Is there a known workaround?</p>