-
1. Re: Teiid PUSHDOWN UDF function question
rareddy Jan 15, 2015 11:47 AM (in response to kchen007)If a function needs to be pushed down to the source, then it must be defined in on the source model. When a UDF defined on the view model, then you need to supply the implementation specifics and that will not be push down.
-
2. Re: Teiid PUSHDOWN UDF function question
blafond Jan 15, 2015 12:10 PM (in response to kchen007)1 of 1 people found this helpfulSee: Chapter 6. Creating and Editing Model Objects
Use the Source Function option. Once defined (model saved) the source function will be available in the Transformation Editor's Expression Builder wizard for use in your SQL.
-
3. Re: Teiid PUSHDOWN UDF function question
akshy_harale Jan 22, 2015 2:58 AM (in response to rareddy)Hello Ramesh,
I tried the PUSHDOWN UDF to call native function in sqlserver NEWID() to get unique identifier by referring this document: but i get the following error when
I call the function from VIEW (like this SELECT NEWID() AS UniqueID. Function is defined in source and not having any java implementation) :org.teiid.api.exception.query.ExpressionEvaluationException: TEIID30328 Unable to evaluate NEWID():
TEIID30341 Function MSSql.NEWID is marked in the function metadata as a function that must be evaluated at the source.at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:598) [teiid-engine-8.4.0.Final.jar:8.4.0.Final]
at org.teiid.query.processor.relational.ProjectNode.updateTuple(ProjectNode.java:190) [teiid-engine-8.4.0.Final.jar:8.4.0.Final]
-
4. Re: Teiid PUSHDOWN UDF function question
rareddy Jan 22, 2015 8:19 AM (in response to akshy_harale)Try qualifying the NEWID() like "model.NEWID()"
-
5. Re: Teiid PUSHDOWN UDF function question
akshy_harale Jan 22, 2015 8:33 AM (in response to rareddy)I tried as what you said but still getting the same error.
-
6. Re: Teiid PUSHDOWN UDF function question
shawkins Jan 22, 2015 8:36 AM (in response to akshy_harale)It is resolving appropriately. It's an issue of planning. The plan that is being created probably cannot push the function to the source and thus the exception. With a later version of Teiid there is more planning specifically for pushing must pushdown functions and even if it can't be pushed but the source supports values or a select without a from, then we'll still evaluate the function.
-
7. Re: Teiid PUSHDOWN UDF function question
jietao Jan 21, 2016 9:25 AM (in response to shawkins)can we work around with this exception in Teiid designer? I called the Hive get_json_object() method in my virtual procedure and got also this TeeidSQLException: Function Hive13.get_json_object is marked in the function metadata as a function that must be evaluated at the source. I use Teiid-8.12.2
-
8. Re: Teiid PUSHDOWN UDF function question
shawkins Jan 21, 2016 11:49 AM (in response to jietao)> can we work around with this exception in Teiid designer? I called the Hive get_json_object() method in my virtual procedure and got also this TeeidSQLException: Function Hive13.get_json_object is marked in the function metadata as a function that must be evaluated at the source. I use Teiid-8.12.2
It would be good to start a new thread. We'll need to confirm that the function is properly defined for pushdown and ideally have the query plan as well.