[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)
9 years, 2 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)
9 years, 2 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)
9 years, 2 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)
9 years, 2 months
[JBoss JIRA] (TEIID-3878) java.lang.Integer cannot be cast to java.math.BigDecimal
by Mark Tawk (JIRA)
Mark Tawk created TEIID-3878:
--------------------------------
Summary: java.lang.Integer cannot be cast to java.math.BigDecimal
Key: TEIID-3878
URL: https://issues.jboss.org/browse/TEIID-3878
Project: Teiid
Issue Type: Feature Request
Reporter: Mark Tawk
Assignee: Steven Hawkins
Priority: Critical
I'm using Teiid 8.11.3 with oracle translator.
I have an aggregated query using teiid materialized views with the following simplified criteria:
(CASE WHEN ( "table1"."field1" = 1 ) THEN "table2"."yearfield" ELSE null END IN (2014) )
The above criteria is reproducing a ClassCastException Integer cannot be cast to BigDecimal
if I change the criteria to the following, it passes without a problem:
("table2"."yearfield" IN (2014) )
Here is the error stack:
java.lang.ClassCastException: java.lang.Integer cannot be cast to java.math.BigDecimal
at java.math.BigDecimal.compareTo(BigDecimal.java:219)
at org.teiid.query.sql.symbol.Constant$2.compare(Constant.java:99)
at org.teiid.query.eval.Evaluator.compare(Evaluator.java:581)
at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:322)
at org.teiid.query.eval.Evaluator.internalEvaluateTVL(Evaluator.java:236)
at org.teiid.query.eval.Evaluator.evaluateTVL(Evaluator.java:225)
at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:219)
at org.teiid.query.processor.relational.JoinNode.matchesCriteria(JoinNode.java:353)
at org.teiid.query.processor.relational.EnhancedSortMergeJoinStrategy.process(EnhancedSortMergeJoinStrategy.java:460)
at org.teiid.query.processor.relational.JoinNode.nextBatchDirect(JoinNode.java:227)
at org.teiid.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:278)
at org.teiid.query.processor.BatchCollector$BatchProducerTupleSource.nextTuple(BatchCollector.java:94)
at org.teiid.query.processor.relational.GroupingNode.groupSortPhase(GroupingNode.java:490)
at org.teiid.query.processor.relational.GroupingNode.nextBatchDirect(GroupingNode.java:366)
at org.teiid.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:278)
at org.teiid.query.processor.relational.ProjectNode.nextBatchDirect(ProjectNode.java:148)
at org.teiid.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:278)
at org.teiid.query.processor.relational.RelationalPlan.nextBatch(RelationalPlan.java:145)
at org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:151)
at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:114)
at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:164)
at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:146)
at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:457)
at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:339)
at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51)
at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:267)
at org.teiid.dqp.internal.process.DQPCore.executeRequest(DQPCore.java:306)
at org.teiid.dqp.internal.process.DQPCore.executeRequest(DQPCore.java:238)
at sun.reflect.GeneratedMethodAccessor260.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.teiid.transport.LocalServerConnection$1$1.call(LocalServerConnection.java:175)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276)
at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:260)
at org.teiid.transport.LocalServerConnection$1.invoke(LocalServerConnection.java:173)
at com.sun.proxy.$Proxy31.executeRequest(Unknown Source)
at org.teiid.jdbc.StatementImpl.execute(StatementImpl.java:667)
at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:533)
at org.teiid.jdbc.StatementImpl.execute(StatementImpl.java:1068)
at org.teiid.jdbc.StatementImpl.execute(StatementImpl.java:320)
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 2 months