-
1. Re: Function not being pushed down
rareddy Nov 20, 2014 12:00 PM (in response to michal.warecki)Which translator? If it is custom translator did you add the supported pushdown functions in the translator?
-
2. Re: Function not being pushed down
michal.warecki Nov 20, 2014 12:11 PM (in response to rareddy)We have custom Execution Factory and we'v registered that function using "addPushDownFunction".
-
3. Re: Function not being pushed down
shawkins Nov 20, 2014 1:17 PM (in response to michal.warecki)We do not yet perform sub-expression pushing of must pushdown functions. A workaround would be to use an inline view:
SELECT AAA, SUM(x) AS BBB_ALIAS FROM /*+ NO_UNNEST */ (select AAA, custom_function(BBB) as x, CCC FROM some_table) as V WHERE CCC = 'VAL' GROUP BY AAA ORDER BY AAA
You can also log an issue to add support.
-
4. Re: Function not being pushed down
michal.warecki Nov 21, 2014 5:02 AM (in response to shawkins)Thanks Steven! JIRA ticket created: [TEIID-3227] Add support for sub-expression pushing of must pushdown functions - JBoss Issue Tracker
EDIT:
With /*+ NO_UNNEST */ it works.
-
5. Re: Function not being pushed down
shawkins Nov 21, 2014 7:33 AM (in response to michal.warecki)The reason no_unnest is required is that Teiid will by default unnest/flatten view layers prior to considering pushdown.
-
6. Re: Function not being pushed down
michal.warecki Nov 21, 2014 7:55 AM (in response to shawkins)I'd like to contribute to Teiid and add support for that sub-expression pushdown. I'm not familiar with the Teiid codebase so if you can point some areas where I could start, I'd be grateful.
Do you think, it will be hard to implement such functionality? I have limited time for this, that's why I'm asking.
Best
-
7. Re: Function not being pushed down
shawkins Nov 21, 2014 8:18 AM (in response to michal.warecki)> I'd like to contribute to Teiid and add support for that sub-expression pushdown.
Excellent.
> I'm not familiar with the Teiid codebase so if you can point some areas where I could start, I'd be grateful.
Do you think, it will be hard to implement such functionality? I have limited time for this, that's why I'm asking.
This may not be a good one to start. The fix will probably broaden [TEIID-964] Must pushdown functions in select clause - JBoss Issue Tracker which targeted the whole expression for simplicity. If you want to start on it, that would be great and at the very least you can compare what you come up with to whatever is checked in as the fix.
-
8. Re: Function not being pushed down
shawkins Nov 21, 2014 12:19 PM (in response to shawkins)I should add that if the translator support selectWithoutFrom, then it will evaluate must pushdown functions as needed - but that would be a single invocation at a time.
-
9. Re: Function not being pushed down
shawkins Dec 3, 2014 12:26 PM (in response to shawkins)[TEIID-3227] Add support for sub-expression pushing of must pushdown functions - JBoss Issue Tracker has been added and will be part of 8.10 Alpha2.
-
10. Re: Function not being pushed down
michal.warecki Dec 4, 2014 8:25 AM (in response to shawkins)That's great Steven, thank you! I'll test that when Alpha2 will be released.