You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Anghel Botos (JIRA)" <ji...@apache.org> on 2017/01/03 10:52:58 UTC

[jira] [Updated] (IGNITE-4518) Wrong WHERE clause generated by org.apache.ignite.cache.store.jdbc.dialect.BasicJdbcDialect#loadCacheRangeQuery for upper bounds

     [ https://issues.apache.org/jira/browse/IGNITE-4518?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Anghel Botos updated IGNITE-4518:
---------------------------------
    Description: 
Scenario:
* Cache entity with 3 key fields mapped to database as columns {{KC1}}, {{KC2}}, {{KC3}}
* The following data is in the database table {{MY_TABLE}} (the values 0 to 4 encoded as binary):
||KC1||KC2||KC3||
|0|0|0|
|0|0|1|
|0|1|0|
|0|1|1|
|1|0|0|

When running {{org.apache.ignite.IgniteCache#loadCache(null)}} (i.e. with no custom SQL query arguments) the following happens:
* In {{org.apache.ignite.cache.store.jdbc.CacheAbstractJdbcStore#loadCache}}, the query produced by {{org.apache.ignite.cache.store.jdbc.dialect.JdbcDialect#loadCacheSelectRangeQuery}} is used to determine the range boundaries for the load. In our case the query would be:
{{SELECT KC1,KC2,KC3 FROM (SELECT KC1,KC2,KC3, ROWNUM AS rn FROM (SELECT KC1,KC2,KC3 FROM MY_TABLE ORDER BY KC1,KC2,KC3)) WHERE mod(rn, 2) = 0}} (I used {{parallelLoadCacheMinThreshold=2}} just as an example so that the problem is visible for this small data set).
The results of this query are:
||KC1||KC2||KC3||
|0|0|1|
|0|1|1|
(which is correct, due to https://issues.apache.org/jira/browse/IGNITE-4163 being fixed now)

> Wrong WHERE clause generated by org.apache.ignite.cache.store.jdbc.dialect.BasicJdbcDialect#loadCacheRangeQuery for upper bounds
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-4518
>                 URL: https://issues.apache.org/jira/browse/IGNITE-4518
>             Project: Ignite
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.8
>            Reporter: Anghel Botos
>
> Scenario:
> * Cache entity with 3 key fields mapped to database as columns {{KC1}}, {{KC2}}, {{KC3}}
> * The following data is in the database table {{MY_TABLE}} (the values 0 to 4 encoded as binary):
> ||KC1||KC2||KC3||
> |0|0|0|
> |0|0|1|
> |0|1|0|
> |0|1|1|
> |1|0|0|
> When running {{org.apache.ignite.IgniteCache#loadCache(null)}} (i.e. with no custom SQL query arguments) the following happens:
> * In {{org.apache.ignite.cache.store.jdbc.CacheAbstractJdbcStore#loadCache}}, the query produced by {{org.apache.ignite.cache.store.jdbc.dialect.JdbcDialect#loadCacheSelectRangeQuery}} is used to determine the range boundaries for the load. In our case the query would be:
> {{SELECT KC1,KC2,KC3 FROM (SELECT KC1,KC2,KC3, ROWNUM AS rn FROM (SELECT KC1,KC2,KC3 FROM MY_TABLE ORDER BY KC1,KC2,KC3)) WHERE mod(rn, 2) = 0}} (I used {{parallelLoadCacheMinThreshold=2}} just as an example so that the problem is visible for this small data set).
> The results of this query are:
> ||KC1||KC2||KC3||
> |0|0|1|
> |0|1|1|
> (which is correct, due to https://issues.apache.org/jira/browse/IGNITE-4163 being fixed now)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)