[JBoss JIRA] (TEIID-4277) Infinispan Cache DSL translator: materialization incomplete results during view's loading
by Van Halbert (JIRA)
[ https://issues.jboss.org/browse/TEIID-4277?page=com.atlassian.jira.plugin... ]
Van Halbert updated TEIID-4277:
-------------------------------
Git Pull Request: https://github.com/teiid/teiid/pull/760, https://github.com/teiid/teiid/pull/761 (was: https://github.com/teiid/teiid/pull/760)
PR 760 8.12.x
PR 761 9.x
> Infinispan Cache DSL translator: materialization incomplete results during view's loading
> -----------------------------------------------------------------------------------------
>
> Key: TEIID-4277
> URL: https://issues.jboss.org/browse/TEIID-4277
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 9.x, 8.12.5
> Reporter: Jan Stastny
> Assignee: Van Halbert
> Priority: Blocker
> Fix For: 8.12.5
>
> Attachments: test.log
>
>
> When user tries to query materialized view in a moment when its loading is in progress, incomplete results are returned. The status of the view in corresponding status table is LOADING.
> Vdb used:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <vdb name="jdg-remote" version="1">
> <description>For testing of materialized views</description>
> <property name ="lib" value ="org.jboss.qe.jdg.pojos"></property>
> <model name="jdgSource">
> <source name="jdgSource" translator-name="jdg-override"
> connection-jndi-name="java:/jdg-mat-ds" />
> <metadata type="DDL"><![CDATA[
> CREATE FOREIGN TABLE CustomerReport(
> customerId integer not null OPTIONS (SEARCHABLE 'Searchable', NATIVE_TYPE 'int'),
> totalAmount integer,
> CONSTRAINT PK_ID PRIMARY KEY(customerId)
> ) OPTIONS (NAMEINSOURCE '${db.table.prefix}jdg-mat', UPDATABLE TRUE);]]>
> </metadata>
> </model>
> <model name="h2Source">
> <source name="h2Source" translator-name="h2" connection-jndi-name="java:/h2-ds" />
> </model>
> <model name="View" type="VIRTUAL">
> <metadata type="DDL"><![CDATA[
> CREATE VIEW external_long_ttl (
> customerId integer NOT NULL,
> totalAmount integer
> ) OPTIONS (MATERIALIZED 'TRUE',
> MATERIALIZED_TABLE 'jdgSource.CustomerReport',
> "teiid_rel:ALLOW_MATVIEW_MANAGEMENT" 'true',
> "teiid_rel:MATVIEW_LOAD_SCRIPT" 'INSERT INTO jdgSource.CustomerReport(customerId,totalAmount) SELECT c.id AS customerId, CONVERT(SUM(o.amount),integer) AS totalAmount FROM DV_MATVIEWS_CUSTOMERS c INNER JOIN DV_MATVIEWS_ORDERS o ON c.id = o.customer_id GROUP BY c.id;',
> "teiid_rel:MATVIEW_STATUS_TABLE" 'h2Source.DB.PUBLIC.DV_MATVIEWS_STATUSTABLE',
> "teiid_rel:MATVIEW_BEFORE_LOAD_SCRIPT" 'execute jdgSource.native(''truncate cache'');',
> "teiid_rel:MATVIEW_AFTER_LOAD_SCRIPT" 'execute jdgSource.native(''swap cache names'');',
> "teiid_rel:MATVIEW_ONERROR_ACTION" 'WAIT',
> "teiid_rel:MATVIEW_TTL" 10000
> )
> AS SELECT c.id AS customerId, CONVERT(SUM(o.amount),integer) AS totalAmount FROM DV_MATVIEWS_CUSTOMERS c INNER JOIN DV_MATVIEWS_ORDERS o ON c.id = o.customer_id GROUP BY c.id;
> ]]>
> </metadata>
> </model>
> <translator name="jdg-override" type="infinispan-cache-dsl">
> <property name="SupportsDirectQueryProcedure" value="true" />
> </translator>
> </vdb>
> {code}
> Resource-adapter used:
> {code:xml}
> <resource-adapter id="jdg-mat">
> <module slot="main" id="org.jboss.teiid.resource-adapter.infinispan.dsl"/>
> <connection-definitions>
> <connection-definition class-name="org.teiid.resource.adapter.infinispan.dsl.InfinispanManagedConnectionFactory" jndi-name="java:/jdg-mat-ds" enabled="true" pool-name="jdg-mat">
> <config-property name="ProtobufDefinitionFile">
> /org/jboss/qe/jdg/remote/protobuf/CustomerReport.proto
> </config-property>
> <config-property name="AliasCacheName">
> ${db.table.prefix}jdg-alias
> </config-property>
> <config-property name="MessageMarshallers">
> org.jboss.qe.jdg.pojo.CustomerReport:org.jboss.qe.jdg.remote.marshaller.CustomerReportMarshaller
> </config-property>
> <config-property name="RemoteServerList">
> [remote-server-address]:11322
> </config-property>
> <config-property name="StagingCacheName">
> ${db.table.prefix}jdg-mat-stage
> </config-property>
> <config-property name="CacheTypeMap">
> ${db.table.prefix}jdg-mat:org.jboss.qe.jdg.pojo.CustomerReport;customerId
> </config-property>
> <config-property name="MessageDescriptor">
> org.jboss.qe.jdg.remote.protobuf.CustomerReport
> </config-property>
> <config-property name="Module">
> org.jboss.qe.jdg.pojos
> </config-property>
> </connection-definition>
> </connection-definitions>
> </resource-adapter>
> {code}
> Datasource used (tables that the view queries):
> {code:xml}
> <xa-datasource jndi-name="java:/h2-ds" pool-name="h2-xa-ds" enabled="true">
> <xa-datasource-property name="URL">
> jdbc:h2:tcp://localhost:9292/db;TRACE_LEVEL_FILE=4
> </xa-datasource-property>
> <driver>h2</driver>
> <security>
> <user-name>sa</user-name>
> </security>
> </xa-datasource>
> {code}
> Query invoked to check current contents of materialized view:
> {code:sql}
> SELECT COUNT(*) FROM external_long_ttl;
> {code}
> And expected result is the same as count of DV_MATVIEWS_CUSTOMERS table from source h2Source. In my case 10.
> But when I print out the result I get all numbers from 0 to 10 . See attached log output (search for 'check-count:')
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 5 months
[JBoss JIRA] (TEIID-4246) HANA translator: boolean column is not valid boolean expression in HANA
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-4246?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration commented on TEIID-4246:
------------------------------------------------
Jan Stastny <jstastny(a)redhat.com> changed the Status of [bug 1343573|https://bugzilla.redhat.com/show_bug.cgi?id=1343573] from ON_QA to VERIFIED
> HANA translator: boolean column is not valid boolean expression in HANA
> -----------------------------------------------------------------------
>
> Key: TEIID-4246
> URL: https://issues.jboss.org/browse/TEIID-4246
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.12.5
> Reporter: Jan Stastny
> Assignee: Steven Hawkins
> Priority: Critical
> Fix For: 9.0, 8.12.5
>
>
> SAP HANA does not take boolean column or literal as boolean expressions.
> Query like this won't pass (invoked on HANA directly):
> {code:sql}
> SELECT (CASE WHEN BooleanValue THEN 'a' ELSE 'b' END) FROM BQT1.smalla;
> {code}
> The following could serve as workaround (invoked on HANA directly):
> {code:sql}
> SELECT (CASE WHEN BooleanValue=true THEN 'a' ELSE 'b' END) FROM BQT1.smalla;
> {code}
> The problem is observable when using boolean column in string function (invoked on Teiid):
> {code:sql}
> SELECT INTKEY, ('test+' || (BOOLEANVALUE || '+test')) FROM BQT1.SmallA ORDER BY IntKey
> {code}
> Which results in following error:
> {code:sql}
> TEIID30504 Remote org.teiid.core.TeiidProcessingException: TEIID30504 HanaSource: 257 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT g_0."INTKEY" AS c_0, concat('test+', concat(CASE WHEN g_0."BOOLEANVALUE" THEN 'true' WHEN not(g_0."BOOLEANVALUE") THEN 'false' END, '+test')) AS c_1 FROM "BQT1"."SMALLA" AS g_0 ORDER BY c_0]
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 5 months
[JBoss JIRA] (TEIID-4333) Change default of SupportsComapareCriteriaOrdered to true
by Van Halbert (JIRA)
[ https://issues.jboss.org/browse/TEIID-4333?page=com.atlassian.jira.plugin... ]
Van Halbert commented on TEIID-4333:
------------------------------------
My initial testing with changing SupportsComapareCriteriaOrdered = true appears to be working when performing LT, LTE, GT and GTE on string columns.
I'm using the following query:
select name, id, email from PersonMatCache.Person where email > 'Bx' and email <= 'Mz'
which is producing query:
OPTIMIZATION COMPLETE:
PROCESSOR PLAN:
AccessNode(0) output=[PersonMatCache.Person.name, PersonMatCache.Person.id, PersonMatCache.Person.email] SELECT g_0.name, g_0.id, g_0.email FROM PersonMatCache.Person AS g_0 WHERE (g_0.email > 'Bx') AND (g_0.email <= 'Mz') LIMIT 100
and appears to be returning the correct results. More testing is needed, but this appears to be good news with the fix in JDG 6.6.
> Change default of SupportsComapareCriteriaOrdered to true
> ---------------------------------------------------------
>
> Key: TEIID-4333
> URL: https://issues.jboss.org/browse/TEIID-4333
> Project: Teiid
> Issue Type: Enhancement
> Components: Misc. Connectors
> Affects Versions: 9.x
> Reporter: Van Halbert
> Assignee: Van Halbert
>
> Change the default of translator capability SupportsComapareCriteriaOrdered from false to true. In JDG 6.6, a fix was made to correct the issue with querying LT, LTE, GT and GTE on string columns.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 5 months
[JBoss JIRA] (TEIID-4334) Prepared insert resolving failure with implicitly named temp table
by Steven Hawkins (JIRA)
Steven Hawkins created TEIID-4334:
-------------------------------------
Summary: Prepared insert resolving failure with implicitly named temp table
Key: TEIID-4334
URL: https://issues.jboss.org/browse/TEIID-4334
Project: Teiid
Issue Type: Bug
Components: Query Engine
Reporter: Steven Hawkins
Assignee: Steven Hawkins
Fix For: 9.1
Similar to TEIID-3994 we will fail to execute a prepared update with explicit columns against a temp table with an implicit name:
create local temporary table #x (e1 string)
insert into #x (e1) values (?) -- fails with a resolving exception
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 5 months
[JBoss JIRA] (TEIID-4333) Change default of SupportsComapareCriteriaOrdered to true
by Van Halbert (JIRA)
Van Halbert created TEIID-4333:
----------------------------------
Summary: Change default of SupportsComapareCriteriaOrdered to true
Key: TEIID-4333
URL: https://issues.jboss.org/browse/TEIID-4333
Project: Teiid
Issue Type: Enhancement
Components: Misc. Connectors
Affects Versions: 9.x
Reporter: Van Halbert
Assignee: Steven Hawkins
Change the default of translator capability SupportsComapareCriteriaOrdered from false to true. In JDG 6.6, a fix was made to correct the issue with querying LT, LTE, GT and GTE on string columns.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 5 months
[JBoss JIRA] (TEIID-4277) Infinispan Cache DSL translator: materialization incomplete results during view's loading
by Van Halbert (JIRA)
[ https://issues.jboss.org/browse/TEIID-4277?page=com.atlassian.jira.plugin... ]
Van Halbert updated TEIID-4277:
-------------------------------
Git Pull Request: https://github.com/teiid/teiid/pull/760
> Infinispan Cache DSL translator: materialization incomplete results during view's loading
> -----------------------------------------------------------------------------------------
>
> Key: TEIID-4277
> URL: https://issues.jboss.org/browse/TEIID-4277
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 9.x, 8.12.5
> Reporter: Jan Stastny
> Assignee: Van Halbert
> Priority: Blocker
> Fix For: 8.12.5
>
> Attachments: test.log
>
>
> When user tries to query materialized view in a moment when its loading is in progress, incomplete results are returned. The status of the view in corresponding status table is LOADING.
> Vdb used:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <vdb name="jdg-remote" version="1">
> <description>For testing of materialized views</description>
> <property name ="lib" value ="org.jboss.qe.jdg.pojos"></property>
> <model name="jdgSource">
> <source name="jdgSource" translator-name="jdg-override"
> connection-jndi-name="java:/jdg-mat-ds" />
> <metadata type="DDL"><![CDATA[
> CREATE FOREIGN TABLE CustomerReport(
> customerId integer not null OPTIONS (SEARCHABLE 'Searchable', NATIVE_TYPE 'int'),
> totalAmount integer,
> CONSTRAINT PK_ID PRIMARY KEY(customerId)
> ) OPTIONS (NAMEINSOURCE '${db.table.prefix}jdg-mat', UPDATABLE TRUE);]]>
> </metadata>
> </model>
> <model name="h2Source">
> <source name="h2Source" translator-name="h2" connection-jndi-name="java:/h2-ds" />
> </model>
> <model name="View" type="VIRTUAL">
> <metadata type="DDL"><![CDATA[
> CREATE VIEW external_long_ttl (
> customerId integer NOT NULL,
> totalAmount integer
> ) OPTIONS (MATERIALIZED 'TRUE',
> MATERIALIZED_TABLE 'jdgSource.CustomerReport',
> "teiid_rel:ALLOW_MATVIEW_MANAGEMENT" 'true',
> "teiid_rel:MATVIEW_LOAD_SCRIPT" 'INSERT INTO jdgSource.CustomerReport(customerId,totalAmount) SELECT c.id AS customerId, CONVERT(SUM(o.amount),integer) AS totalAmount FROM DV_MATVIEWS_CUSTOMERS c INNER JOIN DV_MATVIEWS_ORDERS o ON c.id = o.customer_id GROUP BY c.id;',
> "teiid_rel:MATVIEW_STATUS_TABLE" 'h2Source.DB.PUBLIC.DV_MATVIEWS_STATUSTABLE',
> "teiid_rel:MATVIEW_BEFORE_LOAD_SCRIPT" 'execute jdgSource.native(''truncate cache'');',
> "teiid_rel:MATVIEW_AFTER_LOAD_SCRIPT" 'execute jdgSource.native(''swap cache names'');',
> "teiid_rel:MATVIEW_ONERROR_ACTION" 'WAIT',
> "teiid_rel:MATVIEW_TTL" 10000
> )
> AS SELECT c.id AS customerId, CONVERT(SUM(o.amount),integer) AS totalAmount FROM DV_MATVIEWS_CUSTOMERS c INNER JOIN DV_MATVIEWS_ORDERS o ON c.id = o.customer_id GROUP BY c.id;
> ]]>
> </metadata>
> </model>
> <translator name="jdg-override" type="infinispan-cache-dsl">
> <property name="SupportsDirectQueryProcedure" value="true" />
> </translator>
> </vdb>
> {code}
> Resource-adapter used:
> {code:xml}
> <resource-adapter id="jdg-mat">
> <module slot="main" id="org.jboss.teiid.resource-adapter.infinispan.dsl"/>
> <connection-definitions>
> <connection-definition class-name="org.teiid.resource.adapter.infinispan.dsl.InfinispanManagedConnectionFactory" jndi-name="java:/jdg-mat-ds" enabled="true" pool-name="jdg-mat">
> <config-property name="ProtobufDefinitionFile">
> /org/jboss/qe/jdg/remote/protobuf/CustomerReport.proto
> </config-property>
> <config-property name="AliasCacheName">
> ${db.table.prefix}jdg-alias
> </config-property>
> <config-property name="MessageMarshallers">
> org.jboss.qe.jdg.pojo.CustomerReport:org.jboss.qe.jdg.remote.marshaller.CustomerReportMarshaller
> </config-property>
> <config-property name="RemoteServerList">
> [remote-server-address]:11322
> </config-property>
> <config-property name="StagingCacheName">
> ${db.table.prefix}jdg-mat-stage
> </config-property>
> <config-property name="CacheTypeMap">
> ${db.table.prefix}jdg-mat:org.jboss.qe.jdg.pojo.CustomerReport;customerId
> </config-property>
> <config-property name="MessageDescriptor">
> org.jboss.qe.jdg.remote.protobuf.CustomerReport
> </config-property>
> <config-property name="Module">
> org.jboss.qe.jdg.pojos
> </config-property>
> </connection-definition>
> </connection-definitions>
> </resource-adapter>
> {code}
> Datasource used (tables that the view queries):
> {code:xml}
> <xa-datasource jndi-name="java:/h2-ds" pool-name="h2-xa-ds" enabled="true">
> <xa-datasource-property name="URL">
> jdbc:h2:tcp://localhost:9292/db;TRACE_LEVEL_FILE=4
> </xa-datasource-property>
> <driver>h2</driver>
> <security>
> <user-name>sa</user-name>
> </security>
> </xa-datasource>
> {code}
> Query invoked to check current contents of materialized view:
> {code:sql}
> SELECT COUNT(*) FROM external_long_ttl;
> {code}
> And expected result is the same as count of DV_MATVIEWS_CUSTOMERS table from source h2Source. In my case 10.
> But when I print out the result I get all numbers from 0 to 10 . See attached log output (search for 'check-count:')
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 5 months
[JBoss JIRA] (TEIID-4277) Infinispan Cache DSL translator: materialization incomplete results during view's loading
by Van Halbert (JIRA)
[ https://issues.jboss.org/browse/TEIID-4277?page=com.atlassian.jira.plugin... ]
Van Halbert updated TEIID-4277:
-------------------------------
Affects Version/s: 9.x
> Infinispan Cache DSL translator: materialization incomplete results during view's loading
> -----------------------------------------------------------------------------------------
>
> Key: TEIID-4277
> URL: https://issues.jboss.org/browse/TEIID-4277
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 9.x, 8.12.5
> Reporter: Jan Stastny
> Assignee: Van Halbert
> Priority: Blocker
> Fix For: 8.12.5
>
> Attachments: test.log
>
>
> When user tries to query materialized view in a moment when its loading is in progress, incomplete results are returned. The status of the view in corresponding status table is LOADING.
> Vdb used:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <vdb name="jdg-remote" version="1">
> <description>For testing of materialized views</description>
> <property name ="lib" value ="org.jboss.qe.jdg.pojos"></property>
> <model name="jdgSource">
> <source name="jdgSource" translator-name="jdg-override"
> connection-jndi-name="java:/jdg-mat-ds" />
> <metadata type="DDL"><![CDATA[
> CREATE FOREIGN TABLE CustomerReport(
> customerId integer not null OPTIONS (SEARCHABLE 'Searchable', NATIVE_TYPE 'int'),
> totalAmount integer,
> CONSTRAINT PK_ID PRIMARY KEY(customerId)
> ) OPTIONS (NAMEINSOURCE '${db.table.prefix}jdg-mat', UPDATABLE TRUE);]]>
> </metadata>
> </model>
> <model name="h2Source">
> <source name="h2Source" translator-name="h2" connection-jndi-name="java:/h2-ds" />
> </model>
> <model name="View" type="VIRTUAL">
> <metadata type="DDL"><![CDATA[
> CREATE VIEW external_long_ttl (
> customerId integer NOT NULL,
> totalAmount integer
> ) OPTIONS (MATERIALIZED 'TRUE',
> MATERIALIZED_TABLE 'jdgSource.CustomerReport',
> "teiid_rel:ALLOW_MATVIEW_MANAGEMENT" 'true',
> "teiid_rel:MATVIEW_LOAD_SCRIPT" 'INSERT INTO jdgSource.CustomerReport(customerId,totalAmount) SELECT c.id AS customerId, CONVERT(SUM(o.amount),integer) AS totalAmount FROM DV_MATVIEWS_CUSTOMERS c INNER JOIN DV_MATVIEWS_ORDERS o ON c.id = o.customer_id GROUP BY c.id;',
> "teiid_rel:MATVIEW_STATUS_TABLE" 'h2Source.DB.PUBLIC.DV_MATVIEWS_STATUSTABLE',
> "teiid_rel:MATVIEW_BEFORE_LOAD_SCRIPT" 'execute jdgSource.native(''truncate cache'');',
> "teiid_rel:MATVIEW_AFTER_LOAD_SCRIPT" 'execute jdgSource.native(''swap cache names'');',
> "teiid_rel:MATVIEW_ONERROR_ACTION" 'WAIT',
> "teiid_rel:MATVIEW_TTL" 10000
> )
> AS SELECT c.id AS customerId, CONVERT(SUM(o.amount),integer) AS totalAmount FROM DV_MATVIEWS_CUSTOMERS c INNER JOIN DV_MATVIEWS_ORDERS o ON c.id = o.customer_id GROUP BY c.id;
> ]]>
> </metadata>
> </model>
> <translator name="jdg-override" type="infinispan-cache-dsl">
> <property name="SupportsDirectQueryProcedure" value="true" />
> </translator>
> </vdb>
> {code}
> Resource-adapter used:
> {code:xml}
> <resource-adapter id="jdg-mat">
> <module slot="main" id="org.jboss.teiid.resource-adapter.infinispan.dsl"/>
> <connection-definitions>
> <connection-definition class-name="org.teiid.resource.adapter.infinispan.dsl.InfinispanManagedConnectionFactory" jndi-name="java:/jdg-mat-ds" enabled="true" pool-name="jdg-mat">
> <config-property name="ProtobufDefinitionFile">
> /org/jboss/qe/jdg/remote/protobuf/CustomerReport.proto
> </config-property>
> <config-property name="AliasCacheName">
> ${db.table.prefix}jdg-alias
> </config-property>
> <config-property name="MessageMarshallers">
> org.jboss.qe.jdg.pojo.CustomerReport:org.jboss.qe.jdg.remote.marshaller.CustomerReportMarshaller
> </config-property>
> <config-property name="RemoteServerList">
> [remote-server-address]:11322
> </config-property>
> <config-property name="StagingCacheName">
> ${db.table.prefix}jdg-mat-stage
> </config-property>
> <config-property name="CacheTypeMap">
> ${db.table.prefix}jdg-mat:org.jboss.qe.jdg.pojo.CustomerReport;customerId
> </config-property>
> <config-property name="MessageDescriptor">
> org.jboss.qe.jdg.remote.protobuf.CustomerReport
> </config-property>
> <config-property name="Module">
> org.jboss.qe.jdg.pojos
> </config-property>
> </connection-definition>
> </connection-definitions>
> </resource-adapter>
> {code}
> Datasource used (tables that the view queries):
> {code:xml}
> <xa-datasource jndi-name="java:/h2-ds" pool-name="h2-xa-ds" enabled="true">
> <xa-datasource-property name="URL">
> jdbc:h2:tcp://localhost:9292/db;TRACE_LEVEL_FILE=4
> </xa-datasource-property>
> <driver>h2</driver>
> <security>
> <user-name>sa</user-name>
> </security>
> </xa-datasource>
> {code}
> Query invoked to check current contents of materialized view:
> {code:sql}
> SELECT COUNT(*) FROM external_long_ttl;
> {code}
> And expected result is the same as count of DV_MATVIEWS_CUSTOMERS table from source h2Source. In my case 10.
> But when I print out the result I get all numbers from 0 to 10 . See attached log output (search for 'check-count:')
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 5 months
[JBoss JIRA] (TEIID-4277) Infinispan Cache DSL translator: materialization incomplete results during view's loading
by Van Halbert (JIRA)
[ https://issues.jboss.org/browse/TEIID-4277?page=com.atlassian.jira.plugin... ]
Van Halbert updated TEIID-4277:
-------------------------------
Fix Version/s: 8.12.5
> Infinispan Cache DSL translator: materialization incomplete results during view's loading
> -----------------------------------------------------------------------------------------
>
> Key: TEIID-4277
> URL: https://issues.jboss.org/browse/TEIID-4277
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 9.x, 8.12.5
> Reporter: Jan Stastny
> Assignee: Van Halbert
> Priority: Blocker
> Fix For: 8.12.5
>
> Attachments: test.log
>
>
> When user tries to query materialized view in a moment when its loading is in progress, incomplete results are returned. The status of the view in corresponding status table is LOADING.
> Vdb used:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <vdb name="jdg-remote" version="1">
> <description>For testing of materialized views</description>
> <property name ="lib" value ="org.jboss.qe.jdg.pojos"></property>
> <model name="jdgSource">
> <source name="jdgSource" translator-name="jdg-override"
> connection-jndi-name="java:/jdg-mat-ds" />
> <metadata type="DDL"><![CDATA[
> CREATE FOREIGN TABLE CustomerReport(
> customerId integer not null OPTIONS (SEARCHABLE 'Searchable', NATIVE_TYPE 'int'),
> totalAmount integer,
> CONSTRAINT PK_ID PRIMARY KEY(customerId)
> ) OPTIONS (NAMEINSOURCE '${db.table.prefix}jdg-mat', UPDATABLE TRUE);]]>
> </metadata>
> </model>
> <model name="h2Source">
> <source name="h2Source" translator-name="h2" connection-jndi-name="java:/h2-ds" />
> </model>
> <model name="View" type="VIRTUAL">
> <metadata type="DDL"><![CDATA[
> CREATE VIEW external_long_ttl (
> customerId integer NOT NULL,
> totalAmount integer
> ) OPTIONS (MATERIALIZED 'TRUE',
> MATERIALIZED_TABLE 'jdgSource.CustomerReport',
> "teiid_rel:ALLOW_MATVIEW_MANAGEMENT" 'true',
> "teiid_rel:MATVIEW_LOAD_SCRIPT" 'INSERT INTO jdgSource.CustomerReport(customerId,totalAmount) SELECT c.id AS customerId, CONVERT(SUM(o.amount),integer) AS totalAmount FROM DV_MATVIEWS_CUSTOMERS c INNER JOIN DV_MATVIEWS_ORDERS o ON c.id = o.customer_id GROUP BY c.id;',
> "teiid_rel:MATVIEW_STATUS_TABLE" 'h2Source.DB.PUBLIC.DV_MATVIEWS_STATUSTABLE',
> "teiid_rel:MATVIEW_BEFORE_LOAD_SCRIPT" 'execute jdgSource.native(''truncate cache'');',
> "teiid_rel:MATVIEW_AFTER_LOAD_SCRIPT" 'execute jdgSource.native(''swap cache names'');',
> "teiid_rel:MATVIEW_ONERROR_ACTION" 'WAIT',
> "teiid_rel:MATVIEW_TTL" 10000
> )
> AS SELECT c.id AS customerId, CONVERT(SUM(o.amount),integer) AS totalAmount FROM DV_MATVIEWS_CUSTOMERS c INNER JOIN DV_MATVIEWS_ORDERS o ON c.id = o.customer_id GROUP BY c.id;
> ]]>
> </metadata>
> </model>
> <translator name="jdg-override" type="infinispan-cache-dsl">
> <property name="SupportsDirectQueryProcedure" value="true" />
> </translator>
> </vdb>
> {code}
> Resource-adapter used:
> {code:xml}
> <resource-adapter id="jdg-mat">
> <module slot="main" id="org.jboss.teiid.resource-adapter.infinispan.dsl"/>
> <connection-definitions>
> <connection-definition class-name="org.teiid.resource.adapter.infinispan.dsl.InfinispanManagedConnectionFactory" jndi-name="java:/jdg-mat-ds" enabled="true" pool-name="jdg-mat">
> <config-property name="ProtobufDefinitionFile">
> /org/jboss/qe/jdg/remote/protobuf/CustomerReport.proto
> </config-property>
> <config-property name="AliasCacheName">
> ${db.table.prefix}jdg-alias
> </config-property>
> <config-property name="MessageMarshallers">
> org.jboss.qe.jdg.pojo.CustomerReport:org.jboss.qe.jdg.remote.marshaller.CustomerReportMarshaller
> </config-property>
> <config-property name="RemoteServerList">
> [remote-server-address]:11322
> </config-property>
> <config-property name="StagingCacheName">
> ${db.table.prefix}jdg-mat-stage
> </config-property>
> <config-property name="CacheTypeMap">
> ${db.table.prefix}jdg-mat:org.jboss.qe.jdg.pojo.CustomerReport;customerId
> </config-property>
> <config-property name="MessageDescriptor">
> org.jboss.qe.jdg.remote.protobuf.CustomerReport
> </config-property>
> <config-property name="Module">
> org.jboss.qe.jdg.pojos
> </config-property>
> </connection-definition>
> </connection-definitions>
> </resource-adapter>
> {code}
> Datasource used (tables that the view queries):
> {code:xml}
> <xa-datasource jndi-name="java:/h2-ds" pool-name="h2-xa-ds" enabled="true">
> <xa-datasource-property name="URL">
> jdbc:h2:tcp://localhost:9292/db;TRACE_LEVEL_FILE=4
> </xa-datasource-property>
> <driver>h2</driver>
> <security>
> <user-name>sa</user-name>
> </security>
> </xa-datasource>
> {code}
> Query invoked to check current contents of materialized view:
> {code:sql}
> SELECT COUNT(*) FROM external_long_ttl;
> {code}
> And expected result is the same as count of DV_MATVIEWS_CUSTOMERS table from source h2Source. In my case 10.
> But when I print out the result I get all numbers from 0 to 10 . See attached log output (search for 'check-count:')
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 5 months