Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-801

NullPointerException using USING on table alias with column aliases

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4.0-incubating
    • Component/s: None
    • Labels:
      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)
      

        Activity

        Show
        julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/c57d8072 .
        Hide
        jnadeau Jacques Nadeau added a comment -

        Resolved in release 1.4.0-incubating (2015-08-23)

        Show
        jnadeau Jacques Nadeau added a comment - Resolved in release 1.4.0-incubating (2015-08-23)

          People

          • Assignee:
            julianhyde Julian Hyde
            Reporter:
            julianhyde Julian Hyde
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development