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

RelBuilder.project should combine expressions if underlying node is a Project

    XMLWordPrintableJSON

    Details

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

      Description

      The RelBuilder.project method should combine expressions if underlying node is a Project.

      For example, if r is a RelBuilder and its stack initially contains

      Project(Scan(T), a, b, a + b as c)

      and we call (in pseudo-code)

      r.project(a + c as d)

      then the result should be

      Project(Scan(T), a + (a + b) as d)

      Today the result is

      Project(Project(Scan(T), a, a + b as c), a + c as d)

      In some circumstances the result will be larger (i.e. contain more RexNode instances) but much more frequently the result will be smaller and simpler.

        Attachments

          Activity

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              julianhyde Julian Hyde
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: