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

Annotate table functions to allow pushing down project, filter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      In general it is not possible to push relational operators through table functions but many table functions have properties that will allow push down: for instance, they might preserve fields, preserve row count, return rows in the same order. If we annotate a table function with these properties, we can automatically push down a Filter, and so forth.

      Some ideas:

      • PreservesFieldNames: If an output field has the same name as an input field, it is assumed to be the same field.
      • PreservesRows: Each input row causes exactly one output row, in the same order.
      • FiltersRows: Each input row causes at most one output row, in the same order.
      • PreservesFieldPositions: The leading N columns of the output are equivalent to the leading N columns of the input.

      If (PreservesFieldNames or PreservesFieldPositions) and (PreservesRows or FiltersRows), it is safe to push down a Filter if all of the fields of the predicate exist in the input.

      Similarly pushing down a Project; and we can push down an Aggregate if PreservesRows.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              julianhyde Julian Hyde
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: