[teiid-issues] [JBoss JIRA] (TEIID-3227) Add support for sub-expression pushing of must pushdown functions

Steven Hawkins (JIRA) issues at jboss.org
Mon Nov 24 12:16:39 EST 2014


    [ https://issues.jboss.org/browse/TEIID-3227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13022447#comment-13022447 ] 

Steven Hawkins commented on TEIID-3227:
---------------------------------------

If the function is deterministic, then it's valid to create the pushdown form but we would need to add an aggregate such as first/last or add the function to the grouping (although that wouldn't quite be correct for rollups).

So more than likely this would look like:

SELECT AAA, SUM(first(x)) AS BBB_ALIAS FROM (select AAA, custom_function(BBB) as x from some_table WHERE some_table.CCC = 'VAL') as v GROUP BY AAA ORDER BY AAA

Detecting this is also a little different than the existing must pushdown logic in RuleAssignOutputElements in that we're actually dealing with the grouping node and not a project node when this determination needs to be made.  Although we could rationalize this by inserting an explicit project node, rather than the current logic in the grouping processing node that performs the necessary projection.

> Add support for sub-expression pushing of must pushdown functions
> -----------------------------------------------------------------
>
>                 Key: TEIID-3227
>                 URL: https://issues.jboss.org/browse/TEIID-3227
>             Project: Teiid
>          Issue Type: Feature Request
>          Components: Query Engine
>    Affects Versions: 8.9
>            Reporter: Michał Warecki
>            Assignee: Steven Hawkins
>            Priority: Minor
>
> As a user I'd like to have a possibility to push down sub-expressions of must pushdown functions.
> Example:
> Input query with not supported group by:
> SELECT AAA, SUM(custom_function(BBB)) AS BBB_ALIAS FROM some_table WHERE some_table.CCC = 'VAL' GROUP BY AAA ORDER BY AAA
>  
> Output query (processed by teiid):
> SELECT AAA, BBB AS BBB_ALIAS FROM some_table.CCC = 'VAL'
>  
> What I think it should looks like:
> SELECT AAA, custom_function(BBB) AS BBB_ALIAS FROM some_table.CCC = 'VAL'
> https://developer.jboss.org/message/910926#910926



--
This message was sent by Atlassian JIRA
(v6.3.8#6338)



More information about the teiid-issues mailing list