【发布时间】:2018-07-23 22:24:42
【问题描述】:
除product_price 外,所有字段均可查询。该列存在于表的列列表中。查询会产生这个奇怪的错误:
Failed with exception java.io.IOException:java.lang.IllegalStateException: Group type [message schema {
optional binary product_name (UTF8);
optional binary product_category (UTF8);
optional double product_price;
optional binary purchase_date (UTF8);
optional binary client_ip_address (UTF8);
optional binary pdate;
}
] does not contain requested field: optional double product_price
表是以parquet格式存储的分区表。SHOW CREATE TABLE PURCHASES:
CREATE EXTERNAL TABLE `purchases`(
`product_name` string,
`product_category` string,
`product_price` double,
`purchase_date` string,
`client_ip_address` string)
PARTITIONED BY (
`pdate` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION
'hdfs://quickstart.cloudera:8020/data'
TBLPROPERTIES (
'transient_lastDdlTime'='1532388930')
重要提示:当使用STRING 而不是DOUBLE 或DECIMAL 时,它可以正常工作。
【问题讨论】:
-
你能给我们一个
show create table吗? -
@rahoogan 当然,添加在描述中。