title: Athena and S3 Inventory. HIVE_BAD_DATA: Field size's type LONG in ORC is incompatible with type varchar defined in table schema
body: <p>I'm trying to understand how to work with s3 inventory.
  I'm following this <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html" rel="nofollow noreferrer">tutorial</a></p>
  
  <p>After loading inventory lists into my table I'm trying to query it and find two issues.</p>
  
  <p>1) <code>SELECT key, size FROM table;</code>
  Size column for all records show a magic number(value) 4923069104295859283</p>
  
  <p>2) <code>select * from table;</code>
  Query Id: <code>cf07c309-c685-4bf4-9705-8bca69b00b3c</code>.</p>
  
  <p>Receiving error:</p>
  
  <pre><code>HIVE_BAD_DATA: Field size's type LONG in ORC is incompatible with type varchar defined in table schema
  </code></pre>
  
  <p>Here is my table schema:</p>
  
  <pre><code>CREATE EXTERNAL TABLE `table`(
  `bucket` string, 
  `key` string, 
  `version_id` string, 
  `is_latest` boolean, 
  `is_delete_marker` boolean, 
  `size` bigint, 
  `last_modified_date` timestamp, 
  `e_tag` string, 
  `storage_class` string)
  PARTITIONED BY ( 
  `dt` string)
  ROW FORMAT SERDE 
  'org.apache.hadoop.hive.ql.io.orc.OrcSerde' 
  STORED AS INPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.SymlinkTextInputFormat' 
  OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
  LOCATION
  's3://......../hive'
  TBLPROPERTIES (
  'transient_lastDdlTime'='1516093603')
  </code></pre>