Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Calcite gives a NullPointerException using USING on table alias with column aliases. For example,
select * from (values (100, 'Bill', 1), (200, 'Eric', 1), (150, 'Sebastian', 3)) as e(empid, name, deptno) join (values (1, 'LeaderShip'), (2, 'TestGroup'), (3, 'Development')) as d(deptno, name) using (deptno);
gives
Caused by: java.lang.NullPointerException > at org.apache.calcite.sql2rel.SqlToRelConverter.convertUsing(SqlToRelConverter.java:2306) > at org.apache.calcite.sql2rel.SqlToRelConverter.convertJoinCondition(SqlToRelConverter.java:2279) > at org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(SqlToRelConverter.java:1921) > at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl(SqlToRelConverter.java:601) > at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelect(SqlToRelConverter.java:581) > at org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive(SqlToRelConverter.java:2763) > at org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:535) > at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:222) > at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:188) > at org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:669)