[JBoss JIRA] (TEIID-3270) Allow UDFs to call Teiid functions
by Van Halbert (JIRA)
[ https://issues.jboss.org/browse/TEIID-3270?page=com.atlassian.jira.plugin... ]
Van Halbert commented on TEIID-3270:
------------------------------------
>> Right, but to fully define a UDF, the JAVA_CLASS and JAVA_METHODS properties need to be defined so that the Teiid engine knows what to execute when the function is called in a SQL statement.
>No, the intent of this feature is to allow a virtual function that can be defined using the teiid procedure language.
But I don't see any body (procedure language) defined for the function "f1". So what does Teiid execute in this case?
> Allow UDFs to call Teiid functions
> ----------------------------------
>
> Key: TEIID-3270
> URL: https://issues.jboss.org/browse/TEIID-3270
> Project: Teiid
> Issue Type: Feature Request
> Components: Query Engine
> Reporter: Sanjeev Gour
> Assignee: Steven Hawkins
> Fix For: 8.11
>
>
> Currently custom functions require the implementation on be in Java, there could be an alternative way to allow using Teiid expressions inside the custom functions. The related thread is here-
> https://developer.jboss.org/thread/251179
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 3 months
[JBoss JIRA] (TEIID-3270) Allow UDFs to call Teiid functions
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3270?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-3270:
---------------------------------------
> Right, but to fully define a UDF, the JAVA_CLASS and JAVA_METHODS properties need to be defined so that the Teiid engine knows what to execute when the function is called in a SQL statement.
No, the intent of this feature is to allow a virtual function that can be defined using the teiid procedure language.
> Interestingly, EXECing the function works, but does not return a result set, but a scalar, so the only way I found to get to the result is something like this:
Under the covers it is defined first as a procedure and then special handling is added to allow calling as a function. We are not specifically shutting off the procedural aspect for calling the function.
> Allow UDFs to call Teiid functions
> ----------------------------------
>
> Key: TEIID-3270
> URL: https://issues.jboss.org/browse/TEIID-3270
> Project: Teiid
> Issue Type: Feature Request
> Components: Query Engine
> Reporter: Sanjeev Gour
> Assignee: Steven Hawkins
> Fix For: 8.11
>
>
> Currently custom functions require the implementation on be in Java, there could be an alternative way to allow using Teiid expressions inside the custom functions. The related thread is here-
> https://developer.jboss.org/thread/251179
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 3 months
[JBoss JIRA] (TEIID-3270) Allow UDFs to call Teiid functions
by Andrej Šmigala (JIRA)
[ https://issues.jboss.org/browse/TEIID-3270?page=com.atlassian.jira.plugin... ]
Andrej Šmigala commented on TEIID-3270:
---------------------------------------
[~rareddy] yes, does not work either.
Interestingly, EXECing the function works, but does not return a result set, but a scalar, so the only way I found to get to the result is something like this:
{code:sql}
CREATE VIRTUAL FUNCTION f1(p1 integer) RETURNS integer AS RETURN p1;
CREATE VIRTUAL PROCEDURE testProc (p integer) RETURNS TABLE ( result integer ) AS
BEGIN
DECLARE integer VARIABLES.v1 = ( EXEC f1(p));
SELECT VARIABLES.v1 AS result;
END;
{code}
> Allow UDFs to call Teiid functions
> ----------------------------------
>
> Key: TEIID-3270
> URL: https://issues.jboss.org/browse/TEIID-3270
> Project: Teiid
> Issue Type: Feature Request
> Components: Query Engine
> Reporter: Sanjeev Gour
> Assignee: Steven Hawkins
> Fix For: 8.11
>
>
> Currently custom functions require the implementation on be in Java, there could be an alternative way to allow using Teiid expressions inside the custom functions. The related thread is here-
> https://developer.jboss.org/thread/251179
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 3 months
[JBoss JIRA] (TEIID-3270) Allow UDFs to call Teiid functions
by Andrej Šmigala (JIRA)
[ https://issues.jboss.org/browse/TEIID-3270?page=com.atlassian.jira.plugin... ]
Andrej Šmigala reopened TEIID-3270:
-----------------------------------
It is now possible to define a virtual function using Teiid SQL, but using such a function in a query results in the following error:
{{org.teiid.api.exception.query.QueryResolverException: TEIID30068 The function 'f1(42)' is an unknown form. Check that the function name and number of arguments is correct.}}
This is the VDB I'm using:
{code:xml}
<vdb name="ddlfunctions" version="1">
<model visible="true" type="VIRTUAL" name="FunctionModel">
<metadata type="DDL"><![CDATA[
CREATE VIRTUAL FUNCTION f1(p1 integer) RETURNS integer AS RETURN p1;
]]>
</metadata>
</model>
</vdb>
{code}
> Allow UDFs to call Teiid functions
> ----------------------------------
>
> Key: TEIID-3270
> URL: https://issues.jboss.org/browse/TEIID-3270
> Project: Teiid
> Issue Type: Feature Request
> Components: Query Engine
> Reporter: Sanjeev Gour
> Assignee: Steven Hawkins
> Fix For: 8.11
>
>
> Currently custom functions require the implementation on be in Java, there could be an alternative way to allow using Teiid expressions inside the custom functions. The related thread is here-
> https://developer.jboss.org/thread/251179
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 3 months