[
https://issues.jboss.org/browse/TEIIDDES-2880?page=com.atlassian.jira.plu...
]
Matej Kralik reopened TEIIDDES-2880:
------------------------------------
Preview still doesn't work. I set jar file as deployable and it was deployed on the
server. But preview doesn't work.
In the server log:
{code:java}
TEIID31080 view.tab validation error: TEIID30068 The function
'udfConcatNull(hsqldbParts.PARTS.PART_NAME, hsqldbParts.PARTS.PART_WEIGHT)' is an
unknown form. Check that the function name and number of arguments is correct.
{code}
I noticed that in the "Preview VDB XML Content" missing:
+*<property name="lib"
value="deployment.MyTestUdf-1.0-SNAPSHOT"/>*+
Preview VDB XML Content:
{code:java}
<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
<vdb name="PREVIEW-1e69aa9a-ac0d-40ed-b83d-0a771287fecd"
version="1">
<description>Importer VDB</description>
<property name="UseConnectorMetadata" value="true" />
<model name="view" type="VIRTUAL" visible="true">
<metadata type="DDL"><![CDATA[
CREATE VIEW tab (
NAME_WEIGHT string(510)
) OPTIONS(UPDATABLE 'TRUE')
AS
select udfConcatNull(hsqldbParts.PARTS.PART_NAME,hsqldbParts.PARTS.PART_WEIGHT) as
NAME_WEIGHT from hsqldbParts.PARTS;
]]></metadata>
</model>
<model name="hsqldbParts" type="PHYSICAL"
visible="true">
<source name="hsqldbParts" translator-name="oracle"
connection-jndi-name="java:/hsqldbParts" />
<metadata type="DDL"><![CDATA[
CREATE FOREIGN TABLE PARTS (
PART_ID string(4) NOT NULL OPTIONS(NAMEINSOURCE '"PART_ID"',
FIXED_LENGTH 'TRUE'),
PART_NAME string(255) OPTIONS(NAMEINSOURCE '"PART_NAME"'),
PART_COLOR string(30) OPTIONS(NAMEINSOURCE '"PART_COLOR"'),
PART_WEIGHT string(255) OPTIONS(NAMEINSOURCE '"PART_WEIGHT"'),
CONSTRAINT PK_PARTS PRIMARY KEY(PART_ID) OPTIONS(NAMEINSOURCE
'"PK_PARTS"')
) OPTIONS(NAMEINSOURCE '"PARTSSUPPLIER"."PARTS"', UPDATABLE
'TRUE');
]]></metadata>
</model>
</vdb>
{code}
New preview not working with table that calls UDF function
-----------------------------------------------------------
Key: TEIIDDES-2880
URL:
https://issues.jboss.org/browse/TEIIDDES-2880
Project: Teiid Designer
Issue Type: Bug
Affects Versions: 10.0.1
Environment: MAC
Reporter: Matus Makovy
Assignee: Barry LaFond
Priority: Critical
Fix For: 11.1
Attachments: view.xmi
I have a view model with UDF function defined as procedure and a table that uses this UDF
procedure. Transformation SQL looks like this:
{code:SQL}
SELECT
udfConcatNull(hsqldbParts.PARTS.PART_NAME, hsqldbParts.PARTS.PART_WEIGHT) AS
NAME_WEIGHT
FROM
hsqldbParts.PARTS
{code}
When I hit Preview Data on that table, the dynamic VDB that is generated looks like
this:
{code:xml}
<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
<vdb name="PREVIEW-fd6cadf2-4ae3-4d8f-9420-22f4882201e7"
version="1">
<description>Importer VDB</description>
<property name="UseConnectorMetadata" value="true" />
<property name="deployment-name"
value="PREVIEW-fd6cadf2-4ae3-4d8f-9420-22f4882201e7-vdb.xml" />
<model name="view" type="VIRTUAL" visible="true">
<metadata type="DDL"><![CDATA[
CREATE VIEW tab (
NAME_WEIGHT string
)
AS
select udfConcatNull(hsqldbParts.PARTS.PART_NAME,hsqldbParts.PARTS.PART_WEIGHT) as
NAME_WEIGHT from hsqldbParts.PARTS;
]]></metadata>
</model>
<model name="hsqldbParts" type="PHYSICAL"
visible="true">
<source name="hsqldbParts" translator-name="oracle"
connection-jndi-name="null" />
<metadata type="DDL"><![CDATA[
CREATE FOREIGN TABLE PARTS (
PART_ID string(4) NOT NULL OPTIONS(NAMEINSOURCE '"PART_ID"',
NATIVE_TYPE 'CHAR', FIXED_LENGTH 'TRUE'),
PART_NAME string(255) OPTIONS(NAMEINSOURCE '"PART_NAME"', NATIVE_TYPE
'VARCHAR2'),
PART_COLOR string(30) OPTIONS(NAMEINSOURCE '"PART_COLOR"', NATIVE_TYPE
'VARCHAR2'),
PART_WEIGHT string(255) OPTIONS(NAMEINSOURCE '"PART_WEIGHT"',
NATIVE_TYPE 'VARCHAR2'),
CONSTRAINT PK_PARTS PRIMARY KEY(PART_ID)
) OPTIONS(NAMEINSOURCE '"PARTSSUPPLIER"."PARTS"')
]]></metadata>
</model>
</vdb>
{code}
If I see correctly, the UDF procedure is not in the dynamic VDB.
I know that the situation about dynamic VDBs and UDF functions in JAR files is
complicated and I am not sure right now how this should be resolved.
But in my opinion the udf procedure should be in the dynamic VDB and there should be a
warning that TD won't deploy the JAR to the server and if user wants to make a
preview, the JAR should be deployed to the server manually. (If I remember correctly there
is one when user is trying to generate dynamic VDB from static VDB with UDF function)
View model attached
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)