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

AssertionError while translating query with WITH and correlated sub-query

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.12.0
    • None

    Description

      If a query has a WITH clause with column aliases, and also a correlated sub-query, Optiq gives an AssertionError while trying to translate a field name.

      with t (a, b) as (select * from (values (1, 2)))
      select * from t where exists (select 1 from emp where deptno = t.a);
      
      Caused by: java.lang.AssertionError: Internal error: Type 'RecordType(INTEGER A, INTEGER B)' has no field 'EXPR$0'
      	at org.eigenbase.util.Util.newInternal(Util.java:734)
      	at org.eigenbase.rex.RexBuilder.makeFieldAccess(RexBuilder.java:133)
      	at org.eigenbase.sql2rel.SqlToRelConverter.convertIdentifier(SqlToRelConverter.java:3223)
      

      Attachments

        Activity

          People

            julianhyde Julian Hyde
            julianhyde Julian Hyde
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: