Julian Hyde created CALCITE-1234:
------------------------------------

             Summary: Annotate table functions to allow pushing down project, 
filter
                 Key: CALCITE-1234
                 URL: https://issues.apache.org/jira/browse/CALCITE-1234
             Project: Calcite
          Issue Type: Bug
            Reporter: Julian Hyde
            Assignee: Julian Hyde


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}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to