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

Sub-query inside aggregate function

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.7.0
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: