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

The "exists" library function throws a "param not found" error when a column is used in lambda evaluation logic.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • core
    • None

    Description

      The following query is throwing a "param not found" in calcite whereas the same query works fine in apache spark.

      select *
      from (select array(1, 2, 3) as arr) as t1 inner join
           (select 1 as v) as t2 on "EXISTS"(arr, x -> x = t2.v); 

      The following error reported for the above query

      > java.sql.SQLException: Error while executing SQL "select *
      > from (select array(1, 2, 3) as arr) as t1 inner join
      >      (select 1 as v) as t2 on "EXISTS"(arr, x -> x = t2.v)": From line 3, column 54 to line 3, column 57: Param 'T2.V' not found in lambda expression '`X` -> `X` = `T2`.`V`' 

      Steps to repro:
      1. Place the query in lambda.iq
      2. Run CoreQuidemTest.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              hanu.ncr Hanumath Rao Maduri
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: