-
1. Re: "cannot be pushed to source" error when calling source function, with parameters referred to table columns.
shawkins Apr 2, 2019 9:04 AM (in response to cshong)> In query 2, I passed values of columns of another table as function parameters, and I am sure that the table column data type match the function parameter data type. But, the query failed with error "cannot be pushed to source".
This is expected to work. Can you log an issue for that?
> Any solution?
An ugly workaround would be to use a procedure:
begin create local temporary table t (c bigdecimal); loop on (SELECT TAB1.STRINGCOL, TAB1.DATE FROM MODEL2.TABLE1 TAB1) as x begin insert into t values (MODEL1."dbo.examplefunc"(STRINGCOL, DATE, TRUE) ); end select * from t; end
If there is another source table on MODEL1 another slightly less ugly workaround would be to use a subquery associated with MODEL1:
SELECT (SELECT MODEL1."dbo.examplefunc"(TAB1.STRINGCOL, TAB1.DATE, TRUE) FROM MODEL1.TABLEX LIMIT 1) MODEL2.TABLE1 TAB1
-
2. Re: "cannot be pushed to source" error when calling source function, with parameters referred to table columns.
rareddy Apr 2, 2019 8:41 AM (in response to cshong)When you create a CREATE FOREIGN FUNCTION is a function exposed by the source, by currently not defined in Teiid's translator. By defining the function you are creating an alias for the source function, so it needs to exactly match to that of the source in this case SQLServer. By default, this function is set to pushdown. It typically should not matter whether you used the literals or expressions in the parameters. Can you provide full exception stack?
-
3. Re: "cannot be pushed to source" error when calling source function, with parameters referred to table columns.
cshong Apr 2, 2019 10:21 PM (in response to shawkins)This issue exist, even on a freshly installed version 12.1. I will try to log an issue.
-
4. Re: "cannot be pushed to source" error when calling source function, with parameters referred to table columns.
shawkins Apr 4, 2019 5:07 PM (in response to cshong)I've already got the code ready, so this was captured as [TEIID-5714] Can't push cross source function - JBoss Issue Tracker