TStatus(statusCode:ERROR_STATUS, sqlState:HY000, errorMessage:IllegalStateException: null
解决方法:
select t1.citycode,count(distinct t1.cardno,t1.ndate) cnt,round(sum(t1.amount),2) amount from t2
inner join t1 on t1.cardno = t2.cardno
group by citycode
执行以上sql报错如下:
SQL 错误 [500051] [HY000]: [Cloudera][ImpalaJDBCDriver](500051) ERROR processing query/statement. Error Code: 0, SQL state: TStatus(statusCode:ERROR_STATUS, sqlState:HY000, errorMessage:IllegalStateException: null
后来调整count(distinct t1.cardno,t1.ndate) cnt到最后位置就没问题:
select t1.citycode,round(sum(t1.amount),2) amount,count(distinct t1.cardno,t1.ndate) cnt from t2
inner join t1 on t1.cardno = t2.cardno
group by citycode