Running alter-view on Teiid view is giving issues with it's column data types
rajkota Dec 11, 2012 7:23 PMHi,
I am working in Mark Addleman's team. I believe you might be having good idea about how we are using Teiid in our product .
I am getting below kind of errors from some of the views when I run 'alter view' on all our views.
[stdout] (pool-11-thread-8) Caused by: org.teiid.jdbc.TeiidSQLException: TEIID30492 The definition for chorus_platform_chorus_metadata.tree_definition has the wrong type for column 5. Expected boolean, but was string.
[stdout] (pool-11-thread-8) at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:113)
at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:70)
We are having view definition for tree_definition like below:
<models>
--------
<model name="chorus_platform_metadata_file">
<translator type="file" datasource="java:/CHORUS-PLATFORM-METADATA-FILE-DS" >
<property key="ExceptionIfFileNotFound" value="true" />
</translator>
</model>
<model name="chorus_platform_chorus_metadata">
<view name="tree_definition">
<columns>
<column name="UI_AREA" type="varchar" />
<column name="SECTION" type="varchar" />
<column name="OBJECT_SEQ" type="varchar" />
<column name="OBJECT_NAME" type="varchar" />
<column name="LEVEL" type="boolean" />
<column name="CONFIG" type="varchar" />
<column name="LAZY" type="boolean" />
</columns>
<definition>
SELECT UI_AREA, SECTION, OBJECT_SEQ, OBJECT_NAME, LEVEL,
CONFIG, LAZY
FROM
(call
chorus_platform_metadata_file.getTextFiles('metadata-treedefinition.txt'))AS
f,
TEXTTABLE(F.file
COLUMNS
UI_AREA string,
SECTION string,
OBJECT_SEQ string,
OBJECT_NAME string,
LEVEL boolean,
CONFIG string,
LAZY boolean
HEADER 1) AS t
</definition>
</view>
</model>
-----------
</models>
In above view, no need to have a boolean column in it's definition but TEIID is insisting to change it to boolean.
Here is the Alter View SQL string:
alter view chorus_platform_chorus_metadata.tree_definition as SELECT UI_AREA, SECTION, OBJECT_SEQ, OBJECT_NAME, LEVEL, CONFIG, LAZY FROM (call chorus_platform_metadata_file.getTextFiles('metadata-treedefinition.txt'))AS f, TEXTTABLE(F.file COLUMNS UI_AREA string, SECTION string, OBJECT_SEQ string, OBJECT_NAME string, LEVEL string, CONFIG string, LAZY boolean HEADER 1) AS t
In case if I change the data type of particular column for which TEIID is reporting issue as part of a view, sometimes surprisingly, it is giving the same issue again.
Querying to the view - 'select * from chorus_platform_chorus_metadata.tree_definition' - is working fine.
Can you please throw some thoughts here on the reasons for the above issue?
I modified TeiidEmbeddedPortfolio.java to include and run alter view statements by similuating same view, it worked fine.
I am attaching our log file here. Please take a look into it.
Thanks, Raj
-
AlterView.log.zip 28.9 KB