执行HQL直接被退出:Remote side unexpectedly closed network connection
- HQL语句
- 执行情况描述
- 原因
- 正确HQL
HQL语句
select city,layer, avg(total/size) from
(
select city,houseinfo[0] layer,substring(houseinfo[4],0,length(houseinfo[4])-2) as size,
total from tb_ke_house
) t
group by city,layer;
执行情况描述
执行上述HQL,当执行到Map阶段时候,直接退出了当前执行语句,hdfs集群页一并被强制停止了。
原因
隐式转换
带来的问题,修改HQL语句将size在子查询中做cast强制转换
正确HQL
select city,layer, avg(total/size) from
(
select city,houseinfo[0] layer,cast(substring(houseinfo[4],0,length(houseinfo[4])-2) as int) as size,
total from tb_ke_house
) t
group by city,layer;
结束!
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.e1idc.net