HIVE ORC格式的表查询报错
Failed with exception java.io.IOException:java.lang.ClassCastException: org.apache.hadoop.hive.ql.io.orc.OrcStruct cannot be cast to org.apache.hadoop.io.BinaryComparable
建表语句如下:
CREATE EXTERNAL TABLE `test_orc`(
`test` string, `value` string)PARTITIONED BY ( `dt` int, `dh` int)ROW FORMAT DELIMITED FIELDS TERMINATED BY '\u0001' STORED AS INPUTFORMAT 'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat';此语句是错误的,是从已有表中通过show create table 查询出来的,正确的应该如下:
CREATE EXTERNAL TABLE `test_orc`(
`test` string, `value` string)PARTITIONED BY (
`dt` int, `dh` int)ROW FORMAT DELIMITED FIELDS TERMINATED BY '\u0001'STORED AS ORC
参考 http://knowledge.teradata.com/support/general/kcs.nsf/id/KCS007752