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

Add operand type that will cause a rule to fire when a new subset is created

    Details

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

      Description

      For trait propagation, it would be useful to be able to create a rule that is fired each time a relational expression (`RelNode`) is available with a set of traits (`RelTraitSet`) that it didn't previously have.

      Currently if you create an operand for an input to a relational expression, the rule will be fired every time a relational expression is added to that set (`RelSet`) or subset (`RelSubset`); if you do not create an operand, the rule will be fired once (basically, when the set is created); this would add something in the middle, firing the rule once for each subset. (A subset, you recall, is the combination of a set and a set of traits.)

      For instance, you could write a rule for sort-aggregation. If we are trying to evaluate `select ... group by x`, then the rule might fire once for `AggregateRel` on a subset sorted by [y], once for `AggregateRel` on a subset sorted by [x, y], once for an `AggregateRel` sorted on [x]. The firings for [x, y] and [x] could produce a sort-aggregation, because sort-aggregation requires the grouping key to be on the leading edge of the sort-key.

      ---------------- Imported from GitHub ----------------
      Url: https://github.com/julianhyde/optiq/issues/263
      Created by: julianhyde
      Labels:
      Created at: Sat Apr 26 02:32:24 CEST 2014
      State: closed

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              github-import GitHub Import
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: