Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-15584

Calcite. Failed to parse query with IN and simple subquery.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • sql

    Description

      query I
      SELECT 1 AS one WHERE 1 IN (SELECT 1);
      ----
      1
      
      statement ok
      CREATE TABLE tbl(a TINYINT, b SMALLINT, c INTEGER, d BIGINT, e VARCHAR, f DATE, g TIMESTAMP)
      
      statement ok
      INSERT INTO tbl VALUES (1, 2, 3, 4, '5', DATE '1992-01-01', TIMESTAMP '1992-01-01 00:00:00')
      
      query T
      SELECT EXISTS(SELECT t1.c,t1.d WHERE t1.d<100) FROM tbl t1
      ----
      true
      
      class org.apache.ignite.IgniteException: Error at: (t.test:14). sql: SELECT 1 AS one WHERE 1 IN (SELECT 1);
      
      	at org.apache.ignite.internal.processors.query.calcite.logical.SqlScriptRunner$Query.execute(SqlScriptRunner.java:562)
      	at org.apache.ignite.internal.processors.query.calcite.logical.SqlScriptRunner.run(SqlScriptRunner.java:115)
      	at org.apache.ignite.internal.processors.query.calcite.logical.ScriptTestRunner$1.run(ScriptTestRunner.java:219)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: class org.apache.ignite.internal.processors.query.IgniteSQLException: Failed to parse query.
      	at org.apache.ignite.internal.processors.query.calcite.util.Commons.parse(Commons.java:205)
      	at org.apache.ignite.internal.processors.query.calcite.exec.ExecutionServiceImpl.executeQuery(ExecutionServiceImpl.java:390)
      	at org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.query(CalciteQueryProcessor.java:276)
      
      /any_all/test_simple_not_in.test[_ignore]
      /subquery/scalar/test_complex_nested_correlated_subquery.test[_ignore]
      

      Attachments

        Issue Links

          Activity

            People

              ivandasch Ivan Daschinsky
              zstan Evgeny Stanilovsky
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: