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

Syntax error with simple nested select query

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Duplicate
    • Affects Version/s: 1.18.0
    • Fix Version/s: 1.20.0
    • Component/s: core
    • Labels:
      None

      Description

      Below standard  sql-92 query reports  syntax error  in calcite:

      create table test1(id integer, name integer);
      create table test2(id integer, name integer);

      select * from (

      ( select id,name from test1 ) test3

      inner join

      ( select id,name from test2) test4 on test4.id = test3.id

      );

      Caused by: org.apache.calcite.parser.ParseException: Encountered "test3" at line 4, column 31.

      Was expecting one of:
      ")" ...
      "ORDER" ...
      "LIMIT" ...
      "OFFSET" ...
      "FETCH" ...
      "UNION" ...
      "INTERSECT" ...
      "EXCEPT" ...
      "MINUS" ...
      "." ...
      "NOT" ...
      "IN" ...
      "<" ...
      "<=" ...
      ">" ...
      ">=" ...
      "=" ...
      "<>" ...
      "!=" ...
      "BETWEEN" ...
      "LIKE" ...
      "SIMILAR" ...
      "+" ...
      "-" ...
      "*" ...
      "/" ...
      "%" ...
      "||" ...
      "AND" ...
      "OR" ...
      "IS" ...
      "MEMBER" ...
      "SUBMULTISET" ...
      "CONTAINS" ...
      "OVERLAPS" ...
      "EQUALS" ...
      "PRECEDES" ...
      "SUCCEEDS" ...
      "IMMEDIATELY" ...
      "MULTISET" ...
      "[" ...
      "YEAR" ...
      "MONTH" ...
      "DAY" ...
      "HOUR" ...
      "MINUTE" ...
      "SECOND" ...

       

      The above query works in standard databases like postgres/oracle/sql server. This is a commonly generated query pattern by popular BI tools.

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                danny0405 Danny Chen
                Reporter:
                vamshi.v.krishna@gmail.com Vamshi
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: