QiangZhang created KYLIN-4638: --------------------------------- Summary: NPE in org.apache.calcite.runtime.SqlFunctions.toXXX Key: KYLIN-4638 URL: https://issues.apache.org/jira/browse/KYLIN-4638 Project: Kylin Issue Type: Bug Components: Query Engine Affects Versions: all Reporter: QiangZhang Attachments: image-2020-07-14-16-38-41-173.png
I will show two cases: *1.when I execute the following sql,throw NPE* {code:java} // with t1 as ( select '1' as os union select '2' as os ), t2 as ( select '1' as os, '123' as pay, '456' as money ) select t1.os, round(cast(t2.pay as double),2), round(cast(t2.pay as double),3) from t1 left join t2 on t1.os=t2.os {code} *log:* Exception while executing query java.lang.NullPointerException at org.apache.calcite.runtime.SqlFunctions.toDouble(SqlFunctions.java:1759) at Baz$7$1.current(Unknown Source) at org.apache.calcite.linq4j.EnumerableDefaults$TakeWhileEnumerator.moveNext(EnumerableDefaults.java:2950) at org.apache.calcite.linq4j.Linq4j$EnumeratorIterator.next(Linq4j.java:689) at org.apache.calcite.avatica.util.IteratorCursor.next(IteratorCursor.java:46) at org.apache.calcite.avatica.AvaticaResultSet.next(AvaticaResultSet.java:239) at org.apache.kylin.rest.service.QueryService.createResponseFromResultSet(QueryService.java:1015) at org.apache.kylin.rest.service.QueryService.executeRequest(QueryService.java:940) at org.apache.kylin.rest.service.QueryService.queryWithSqlMassage(QueryService.java:641) at org.apache.kylin.rest.service.QueryService.query(QueryService.java:208) *2.* *but when I comment out some line,query is success,why?These two lines are almost identical ,this is strange。I debug the source code about calcite,haven't found the problem yet。* !image-2020-07-14-16-38-41-173.png! -- This message was sent by Atlassian Jira (v8.3.4#803005)