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

In SqlToRelConverter, use RelBuilder for creating Aggregate

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.26.0
    • None
    • None

    Description

      In SqlToRelConverter use RelBuilder for creating Aggregate. Currently we call LogicalAggregate.create directly, and that misses some optimizations.

      Add config option RelBuilder.Config.aggregateUnique() to disable the optimization that we don't create an Aggregate if the input is already unique on the GROUP BY key. Without it, some tests in SqlToRelConverterTest become trivial.

      Also, that optimization is not valid if there are multiple group sets. (Because we should output multiple rows, and Project only returns one.) So disable it in that case.

      Move the the code added by CALCITE-1824 from SqlToRelConverter to RelBuilder. Now the GROUP_ID is handled correctly even if created via RelBuilder.

      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: