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

Metadata (RelMdRowCount) should reflect the fact that an Aggregate with no GROUP BY always returns 1 row

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.29.0, 1.30.0
    • 1.31.0
    • core

    Description

      Currently, RowCount of aggregate without group keys are unexpected.
      The problem could be appear in the following UT:

        @Test void testRowCountAggregateEmptyKey1() {
          fixture()
              .withRelFn(b ->
                  b.scan("EMP")
                      .aggregate(
                          b.groupKey(),
                          b.count(false, "C"))
                      .build())
              .assertThatRowCount(is(1D), is(1D), is(1D));
        }
      

      Now, the above UT would be failed because row count return 1.4D instead of 1D.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jingzhang Jing Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              4 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 - 40m
                  40m