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

AssertionError throws for aggregation with same digest IN subqueries in same scope

    XMLWordPrintableJSON

    Details

      Description

      Check this sql in SqlToRelConverterTest:

      @Test public void testAggregateWithCaseWhen() {
          final String sql = "select\n"
              + "  CASE WHEN job IN ('810000', '820000') THEN job\n"
              + "   ELSE 'error'\n"
              + "  END AS id,\n"
              + "  count(empno)\n"
              + "FROM emp\n"
              + "where job <> '' or job in ('810000', '820000')\n"
              + "GROUP by deptno, job";
          sql(sql).ok();
        }
      

      I tested PostgreSQL 9.6 and MySQL 5.6, this is a valid SQL and they both outputs the right result.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                danny0405 Danny Chen
                Reporter:
                danny0405 Danny Chen
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h