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

Cannot use parentheses after FROM in SQL

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 1.11.0
    • Fix Version/s: 1.14.0
    • Component/s: None
    • Labels:
      None

      Description

      Some BI tools will generate some SQLs like this:

      SELECT COUNT(*) FROM (emps LEFT OUTER JOIN depts ON emps.deptno = depts.deptno);

      In this SQL, the FROM clause is contained within parentheses.

      But always failed with such exception:

      Error: Error while executing SQL "SELECT COUNT(*) FROM (emps LEFT OUTER JOIN depts ON emps.deptno = depts.deptno)": parse failed: Non-query expression encountered in illegal context (state=,code=0)

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: