[JBoss JIRA] (TEIID-4022) Materialization issue dynamic SQL command can't be executed due ambiguous group name
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4022?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-4022.
-----------------------------------
Fix Version/s: 9.0
8.12.5
8.13.2
Resolution: Done
Changed to use the qualified form and corrected/added logging so that errors will be easy to see.
> Materialization issue dynamic SQL command can't be executed due ambiguous group name
> --------------------------------------------------------------------------------------
>
> Key: TEIID-4022
> URL: https://issues.jboss.org/browse/TEIID-4022
> Project: Teiid
> Issue Type: Bug
> Components: Server
> Affects Versions: 8.12.x
> Reporter: Van Halbert
> Assignee: Steven Hawkins
> Priority: Blocker
> Fix For: 9.0, 8.12.5, 8.13.2
>
>
> The defined model for materialization:
> {code}
> <model name="PersonMatModel" type="VIRTUAL">
> <metadata type="DDL"><![CDATA[
> CREATE view PersonMatView
> (
> name string,
> id integer,
> email string
> ) OPTIONS (MATERIALIZED 'TRUE', UPDATABLE 'TRUE',
> MATERIALIZED_TABLE 'PersonMatCache.Person',
> "teiid_rel:MATVIEW_TTL" 60000,
> "teiid_rel:MATVIEW_BEFORE_LOAD_SCRIPT" 'execute PersonMatCache.native(''truncate cache'');',
> "teiid_rel:MATVIEW_AFTER_LOAD_SCRIPT" 'execute PersonMatCache.native(''swap cache names'');',
> "teiid_rel:MATERIALIZED_STAGE_TABLE" 'PersonMatCache.Person',
> "teiid_rel:MATVIEW_SHARE_SCOPE" 'NONE',
> "teiid_rel:ALLOW_MATVIEW_MANAGEMENT" 'true',
> "teiid_rel:MATVIEW_STATUS_TABLE" 'Accounts.status',
> "teiid_rel:MATVIEW_ONERROR_ACTION" 'THROW_EXCEPTION')
> AS SELECT name, id, email from PersonInfoModel.Person;
> ]]>
> </metadata>
> </model>
> {code}
> causes the following exception:
> {code}
> org.teiid.api.exception.query.QueryProcessingException: TEIID30168 Couldn't
> execute the dynamic SQL command "EXECUTE IMMEDIATE ('SELECT count(*) as
> rowCount FROM ' || matViewTable) AS rowCount integer INTO #load_count" with
> the SQL statement "('SELECT count(*) as rowCount FROM ' || matViewTable)" due
> to: Group specified is ambiguous, resubmit the query by fully qualifying the group
> name: Person
> {code}
> And executing the following internal call that Teiid uses does produce the non-qualifed name
> {ccode}
> SELECT TargetName from SYSADMIN.MatViews WHERE VDBName = 'PeopleMat' AND SchemaName = 'PersonMatModel' AND Name = 'PersonMatView'
> {code}
> returns: Person
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 10 months
[JBoss JIRA] (TEIID-3994) AliasSymbol wrapping AliasSymbol error
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-3994?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration updated TEIID-3994:
-------------------------------------------
Bugzilla References: https://bugzilla.redhat.com/show_bug.cgi?id=1314909
Bugzilla Update: Perform
> AliasSymbol wrapping AliasSymbol error
> --------------------------------------
>
> Key: TEIID-3994
> URL: https://issues.jboss.org/browse/TEIID-3994
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.7.1.6_2
> Environment: Red Hat JBoss Data Virtualization 6.2 on EAP6.4.0 patched to version 6.4.3,
> JBoss Developer Studio 8.1.0GA with Teiid Designer plugin 9.0.3.Final.v20150810-1438-B1157
> 64-bit Windows 7 environment
> Reporter: Steve Tran
> Assignee: Steven Hawkins
> Fix For: 9.0, 8.12.5, 8.13.2
>
> Attachments: Oracle.PNG, SQLServer.PNG
>
>
> I've defined a view and overrode the default triggers for Select, Insert, Update, and Delete. I overrode the triggers because the select is returning "hardcoded" values for a few fields (calling them virtual columns). The Update and Insert triggers will ignore these hardcoded values just in case the caller tries to update a virtual column.
> I'm trying to run a insert into <tableA> select * from <tableB> query. When I run this, I get an error org.teiid.jdbc.TeiidSQLException: Cannot create AliasSymbol wrapping AliasSymbol.
> Facts:
> -- I can insert a record if I only select one column from tableB.
> -- If I select two or more columns, it throws the error every time.
> -- If I remove the overridden triggers, the insert into <tableA> select * from <tableB> works fine.
> -- I can insert one or more columns into <tableA> when *not* using a insert into <tableA> select * from <tableB> query
> -- Table A is Oracle
> -- Table B is SQL Server
> My hunch is the generated query (hibernate, or whatever SQL generator) is choking with the overridden trigger. Perhaps this use-case slipped through testing, or even more probable, I made a mistake in the trigger creation.
> Here's a snip of the insert trigger, with a lot of fields removed for simplicity.
> {code}
> FOR EACH ROW
> BEGIN ATOMIC
> INSERT INTO <schema>.<tableA> (SourceSystemID, RecordTypeID, BatchID ...)
> VALUES (
> convert("NEW".SourceSystemID, short),
> convert("NEW".RecordTypeID, short),
> convert("NEW".BatchID, integer)
> ...
> )
> END
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 10 months
[JBoss JIRA] (TEIID-4022) Materialization issue dynamic SQL command can't be executed due ambiguous group name
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4022?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-4022:
---------------------------------------
Looks like there's a lot of unqualified usage of the matTableName that needs to be fixed.
As for the logging of the error, that has been fixed upstream by several changes including TEIID-3995. That can be backported if desired.
> Materialization issue dynamic SQL command can't be executed due ambiguous group name
> --------------------------------------------------------------------------------------
>
> Key: TEIID-4022
> URL: https://issues.jboss.org/browse/TEIID-4022
> Project: Teiid
> Issue Type: Bug
> Components: Server
> Affects Versions: 8.12.x
> Reporter: Van Halbert
> Assignee: Steven Hawkins
> Priority: Blocker
>
> The defined model for materialization:
> {code}
> <model name="PersonMatModel" type="VIRTUAL">
> <metadata type="DDL"><![CDATA[
> CREATE view PersonMatView
> (
> name string,
> id integer,
> email string
> ) OPTIONS (MATERIALIZED 'TRUE', UPDATABLE 'TRUE',
> MATERIALIZED_TABLE 'PersonMatCache.Person',
> "teiid_rel:MATVIEW_TTL" 60000,
> "teiid_rel:MATVIEW_BEFORE_LOAD_SCRIPT" 'execute PersonMatCache.native(''truncate cache'');',
> "teiid_rel:MATVIEW_AFTER_LOAD_SCRIPT" 'execute PersonMatCache.native(''swap cache names'');',
> "teiid_rel:MATERIALIZED_STAGE_TABLE" 'PersonMatCache.Person',
> "teiid_rel:MATVIEW_SHARE_SCOPE" 'NONE',
> "teiid_rel:ALLOW_MATVIEW_MANAGEMENT" 'true',
> "teiid_rel:MATVIEW_STATUS_TABLE" 'Accounts.status',
> "teiid_rel:MATVIEW_ONERROR_ACTION" 'THROW_EXCEPTION')
> AS SELECT name, id, email from PersonInfoModel.Person;
> ]]>
> </metadata>
> </model>
> {code}
> causes the following exception:
> {code}
> org.teiid.api.exception.query.QueryProcessingException: TEIID30168 Couldn't
> execute the dynamic SQL command "EXECUTE IMMEDIATE ('SELECT count(*) as
> rowCount FROM ' || matViewTable) AS rowCount integer INTO #load_count" with
> the SQL statement "('SELECT count(*) as rowCount FROM ' || matViewTable)" due
> to: Group specified is ambiguous, resubmit the query by fully qualifying the group
> name: Person
> {code}
> And executing the following internal call that Teiid uses does produce the non-qualifed name
> {ccode}
> SELECT TargetName from SYSADMIN.MatViews WHERE VDBName = 'PeopleMat' AND SchemaName = 'PersonMatModel' AND Name = 'PersonMatView'
> {code}
> returns: Person
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 10 months
[JBoss JIRA] (TEIID-4022) Materialization issue dynamic SQL command can't be executed due ambiguous group name
by Van Halbert (JIRA)
[ https://issues.jboss.org/browse/TEIID-4022?page=com.atlassian.jira.plugin... ]
Van Halbert commented on TEIID-4022:
------------------------------------
I thought maybe the status table query (or info) was part of the problem, because the TARGETSCHEMANAME was null. Updating it didn't change the loading issue.
> Materialization issue dynamic SQL command can't be executed due ambiguous group name
> --------------------------------------------------------------------------------------
>
> Key: TEIID-4022
> URL: https://issues.jboss.org/browse/TEIID-4022
> Project: Teiid
> Issue Type: Bug
> Components: Server
> Affects Versions: 8.12.x
> Reporter: Van Halbert
> Assignee: Steven Hawkins
> Priority: Blocker
>
> The defined model for materialization:
> {code}
> <model name="PersonMatModel" type="VIRTUAL">
> <metadata type="DDL"><![CDATA[
> CREATE view PersonMatView
> (
> name string,
> id integer,
> email string
> ) OPTIONS (MATERIALIZED 'TRUE', UPDATABLE 'TRUE',
> MATERIALIZED_TABLE 'PersonMatCache.Person',
> "teiid_rel:MATVIEW_TTL" 60000,
> "teiid_rel:MATVIEW_BEFORE_LOAD_SCRIPT" 'execute PersonMatCache.native(''truncate cache'');',
> "teiid_rel:MATVIEW_AFTER_LOAD_SCRIPT" 'execute PersonMatCache.native(''swap cache names'');',
> "teiid_rel:MATERIALIZED_STAGE_TABLE" 'PersonMatCache.Person',
> "teiid_rel:MATVIEW_SHARE_SCOPE" 'NONE',
> "teiid_rel:ALLOW_MATVIEW_MANAGEMENT" 'true',
> "teiid_rel:MATVIEW_STATUS_TABLE" 'Accounts.status',
> "teiid_rel:MATVIEW_ONERROR_ACTION" 'THROW_EXCEPTION')
> AS SELECT name, id, email from PersonInfoModel.Person;
> ]]>
> </metadata>
> </model>
> {code}
> causes the following exception:
> {code}
> org.teiid.api.exception.query.QueryProcessingException: TEIID30168 Couldn't
> execute the dynamic SQL command "EXECUTE IMMEDIATE ('SELECT count(*) as
> rowCount FROM ' || matViewTable) AS rowCount integer INTO #load_count" with
> the SQL statement "('SELECT count(*) as rowCount FROM ' || matViewTable)" due
> to: Group specified is ambiguous, resubmit the query by fully qualifying the group
> name: Person
> {code}
> And executing the following internal call that Teiid uses does produce the non-qualifed name
> {ccode}
> SELECT TargetName from SYSADMIN.MatViews WHERE VDBName = 'PeopleMat' AND SchemaName = 'PersonMatModel' AND Name = 'PersonMatView'
> {code}
> returns: Person
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 10 months
[JBoss JIRA] (TEIID-4022) Materialization issue dynamic SQL command can't be executed due ambiguous group name
by Van Halbert (JIRA)
[ https://issues.jboss.org/browse/TEIID-4022?page=com.atlassian.jira.plugin... ]
Van Halbert edited comment on TEIID-4022 at 3/4/16 1:40 PM:
------------------------------------------------------------
There was no error being seen when this was occurring. The status table was updated to indicate the load had failed. Only after trying to query the cache was the following exception seen:
{code}Caused by: org.teiid.api.exception.query.FunctionExecutionException: TEIID31147 The materialized view PersonMatModel.PersonMatView materialization table is currently not in valid state.
{code}
And the above exception: org.teiid.api.exception.query.QueryProcessingException
was not being seen in the server log, only thru debug did I see the issue found in the ProcedurePlan code (line 394).
was (Author: van.halbert):
Also, to note, the above exception: org.teiid.api.exception.query.QueryProcessingException
was not being seen in the server log, only thru debug did I see the issue found in the ProcedurePlan code (line 394).
> Materialization issue dynamic SQL command can't be executed due ambiguous group name
> --------------------------------------------------------------------------------------
>
> Key: TEIID-4022
> URL: https://issues.jboss.org/browse/TEIID-4022
> Project: Teiid
> Issue Type: Bug
> Components: Server
> Affects Versions: 8.12.x
> Reporter: Van Halbert
> Assignee: Steven Hawkins
> Priority: Blocker
>
> The defined model for materialization:
> {code}
> <model name="PersonMatModel" type="VIRTUAL">
> <metadata type="DDL"><![CDATA[
> CREATE view PersonMatView
> (
> name string,
> id integer,
> email string
> ) OPTIONS (MATERIALIZED 'TRUE', UPDATABLE 'TRUE',
> MATERIALIZED_TABLE 'PersonMatCache.Person',
> "teiid_rel:MATVIEW_TTL" 60000,
> "teiid_rel:MATVIEW_BEFORE_LOAD_SCRIPT" 'execute PersonMatCache.native(''truncate cache'');',
> "teiid_rel:MATVIEW_AFTER_LOAD_SCRIPT" 'execute PersonMatCache.native(''swap cache names'');',
> "teiid_rel:MATERIALIZED_STAGE_TABLE" 'PersonMatCache.Person',
> "teiid_rel:MATVIEW_SHARE_SCOPE" 'NONE',
> "teiid_rel:ALLOW_MATVIEW_MANAGEMENT" 'true',
> "teiid_rel:MATVIEW_STATUS_TABLE" 'Accounts.status',
> "teiid_rel:MATVIEW_ONERROR_ACTION" 'THROW_EXCEPTION')
> AS SELECT name, id, email from PersonInfoModel.Person;
> ]]>
> </metadata>
> </model>
> {code}
> causes the following exception:
> {code}
> org.teiid.api.exception.query.QueryProcessingException: TEIID30168 Couldn't
> execute the dynamic SQL command "EXECUTE IMMEDIATE ('SELECT count(*) as
> rowCount FROM ' || matViewTable) AS rowCount integer INTO #load_count" with
> the SQL statement "('SELECT count(*) as rowCount FROM ' || matViewTable)" due
> to: Group specified is ambiguous, resubmit the query by fully qualifying the group
> name: Person
> {code}
> And executing the following internal call that Teiid uses does produce the non-qualifed name
> {ccode}
> SELECT TargetName from SYSADMIN.MatViews WHERE VDBName = 'PeopleMat' AND SchemaName = 'PersonMatModel' AND Name = 'PersonMatView'
> {code}
> returns: Person
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 10 months
[JBoss JIRA] (TEIID-4022) Materialization issue dynamic SQL command can't be executed due ambiguous group name
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-4022?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration updated TEIID-4022:
-------------------------------------------
Bugzilla References: https://bugzilla.redhat.com/show_bug.cgi?id=1314890
Bugzilla Update: Perform
> Materialization issue dynamic SQL command can't be executed due ambiguous group name
> --------------------------------------------------------------------------------------
>
> Key: TEIID-4022
> URL: https://issues.jboss.org/browse/TEIID-4022
> Project: Teiid
> Issue Type: Bug
> Components: Server
> Affects Versions: 8.12.x
> Reporter: Van Halbert
> Assignee: Steven Hawkins
> Priority: Blocker
>
> The defined model for materialization:
> {code}
> <model name="PersonMatModel" type="VIRTUAL">
> <metadata type="DDL"><![CDATA[
> CREATE view PersonMatView
> (
> name string,
> id integer,
> email string
> ) OPTIONS (MATERIALIZED 'TRUE', UPDATABLE 'TRUE',
> MATERIALIZED_TABLE 'PersonMatCache.Person',
> "teiid_rel:MATVIEW_TTL" 60000,
> "teiid_rel:MATVIEW_BEFORE_LOAD_SCRIPT" 'execute PersonMatCache.native(''truncate cache'');',
> "teiid_rel:MATVIEW_AFTER_LOAD_SCRIPT" 'execute PersonMatCache.native(''swap cache names'');',
> "teiid_rel:MATERIALIZED_STAGE_TABLE" 'PersonMatCache.Person',
> "teiid_rel:MATVIEW_SHARE_SCOPE" 'NONE',
> "teiid_rel:ALLOW_MATVIEW_MANAGEMENT" 'true',
> "teiid_rel:MATVIEW_STATUS_TABLE" 'Accounts.status',
> "teiid_rel:MATVIEW_ONERROR_ACTION" 'THROW_EXCEPTION')
> AS SELECT name, id, email from PersonInfoModel.Person;
> ]]>
> </metadata>
> </model>
> {code}
> causes the following exception:
> {code}
> org.teiid.api.exception.query.QueryProcessingException: TEIID30168 Couldn't
> execute the dynamic SQL command "EXECUTE IMMEDIATE ('SELECT count(*) as
> rowCount FROM ' || matViewTable) AS rowCount integer INTO #load_count" with
> the SQL statement "('SELECT count(*) as rowCount FROM ' || matViewTable)" due
> to: Group specified is ambiguous, resubmit the query by fully qualifying the group
> name: Person
> {code}
> And executing the following internal call that Teiid uses does produce the non-qualifed name
> {ccode}
> SELECT TargetName from SYSADMIN.MatViews WHERE VDBName = 'PeopleMat' AND SchemaName = 'PersonMatModel' AND Name = 'PersonMatView'
> {code}
> returns: Person
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 10 months