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

Extend induce method to return CUBE and ROLLUP

    Details

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

      Description

      Currently the induce method in the Aggregate class only returns two classes of groupings: SIMPLE and OTHER. It needs to be updated to return CUBE and ROLLUP values too.

        Activity

        Hide
        jcamachorodriguez Jesus Camacho Rodriguez added a comment -

        Julian Hyde, I have done a pull request concerning this issue, can you check it? Thanks!

        Show
        jcamachorodriguez Jesus Camacho Rodriguez added a comment - Julian Hyde , I have done a pull request concerning this issue, can you check it? Thanks!
        Show
        julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/3b34d300 .
        Hide
        vladimirsitnikov Vladimir Sitnikov added a comment -
        +      if (groupSets.size() == IntMath.pow(2, groupSet.cardinality())) {
        +        return CUBE;
        +      }

        I suppose groupSets.size() is not sufficient to tell if the grouping is CUBE or not.
        Is it?

        Show
        vladimirsitnikov Vladimir Sitnikov added a comment - + if (groupSets.size() == IntMath.pow(2, groupSet.cardinality())) { + return CUBE; + } I suppose groupSets.size() is not sufficient to tell if the grouping is CUBE or not. Is it?
        Hide
        jcamachorodriguez Jesus Camacho Rodriguez added a comment -

        Given that groupSets does not contain duplicates, that comparison suffices to check whether it is a CUBE or not (all possible combinations of the elements in groupSet are in groupSets ).

        Show
        jcamachorodriguez Jesus Camacho Rodriguez added a comment - Given that groupSets does not contain duplicates, that comparison suffices to check whether it is a CUBE or not (all possible combinations of the elements in groupSet are in groupSets ).
        Hide
        julianhyde Julian Hyde added a comment -

        Jesus Camacho Rodriguez, you're assuming that the elements of groupSets are distinct. In practice, they are – e.g. Aggregate.init calls

        assert Util.isStrictlySorted(groupSets, ImmutableBitSet.COMPARATOR)
        Show
        julianhyde Julian Hyde added a comment - Jesus Camacho Rodriguez , you're assuming that the elements of groupSets are distinct. In practice, they are – e.g. Aggregate.init calls assert Util.isStrictlySorted(groupSets, ImmutableBitSet.COMPARATOR)
        Hide
        julianhyde Julian Hyde added a comment -

        Closing now that 1.0.0-incubating has been released.

        Show
        julianhyde Julian Hyde added a comment - Closing now that 1.0.0-incubating has been released.

          People

          • Assignee:
            jcamachorodriguez Jesus Camacho Rodriguez
            Reporter:
            jcamachorodriguez Jesus Camacho Rodriguez
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development