0
我已經編寫了以下配置單元查詢。這裏我試圖在我的連接子句中使用Map數據類型的列(msg)。使用映射數據類型的Hive查詢失敗
select p.p_id, count(*) from prod_json n
inner join res_pan p on n.msg["mid"] = p.id
where n.cat='XYX'
group by p.p_id limit 10;
此查詢總是失敗,錯誤消息
[Error getting row data with exception java.lang.ClassCastException:
java.lang.String cannot be cast to org.openx.data.jsonserde.json.JSONObject at
org.openx.data.jsonserde.objectinspector.JsonMapObjectInspector.getMap(Json
MapObjectInspector.java:40) at
org.apache.hadoop.hive.serde2.SerDeUtils.buildJSONString(SerDeUtils.java:317) at
org.apache.hadoop.hive.serde2.SerDeUtils.buildJSONString(SerDeUtils.java:353) at
org.apache.hadoop.hive.serde2.SerDeUtils.getJSONString(SerDeUtils.java:197) at
org.apache.hadoop.hive.serde2.SerDeUtils.getJSONString(SerDeUtils.java:183) at
org.apache.hadoop.hive.ql.exec.MapOperator.toErrorMessage(MapOperator.java:
529) at
org.apache.hadoop.hive.ql.exec.MapOperator.process(MapOperator.java:502) at
org.apache.hadoop.hive.ql.exec.mr.ExecMapper.map(ExecMapper.java:170) at
org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:54) at
org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:453) at