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

Sub-query inside aggregate function

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7.0
    • Component/s: None
    • Labels:
      None

      Description

      Calcite SQL-to-rel translator cannot handle a sub-query inside an aggregate function. An example is SqlToRelConverterTest.testAggCaseInSubquery:

      SELECT SUM(
        CASE WHEN deptno IN (SELECT deptno FROM dept) THEN 1
        ELSE 0 END)
      FROM emp

      Similar issue CALCITE-516 involves IN with constant list inside an aggregate function, which is treated similarly to a sub-query but is simpler.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: