You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Ignite TC Bot (Jira)" <ji...@apache.org> on 2021/09/06 15:53:00 UTC

[jira] [Commented] (IGNITE-15263) Setting name in QuerySqlField on affinity field broke affinity awareness in sql.

    [ https://issues.apache.org/jira/browse/IGNITE-15263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17410700#comment-17410700 ] 

Ignite TC Bot commented on IGNITE-15263:
----------------------------------------

{panel:title=Branch: [pull/9338/head] Base: [master] : No blockers found!|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1}{panel}
{panel:title=Branch: [pull/9338/head] Base: [master] : New Tests (37)|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1}
{color:#00008b}Queries 1{color} [[tests 37|https://ci.ignite.apache.org/viewLog.html?buildId=6167309]]
* {color:#013220}IgniteBinaryCacheQueryTestSuite: JoinPartitionPruningSelfTest.testSimpleJoin[createWithSql = true] - PASSED{color}
* {color:#013220}IgniteBinaryCacheQueryTestSuite: CheckWarnJoinPartitionedTables.joinSameTableWithAnnotationAffinityKeyMapped[join=JOIN] - PASSED{color}
* {color:#013220}IgniteBinaryCacheQueryTestSuite: CheckWarnJoinPartitionedTables.joinSameTableWithAnnotationAffinityKeyMapped[join=INNER JOIN] - PASSED{color}
* {color:#013220}IgniteBinaryCacheQueryTestSuite: CheckWarnJoinPartitionedTables.joinSameTableWithAnnotationAffinityKeyMapped[join=RIGHT JOIN] - PASSED{color}
* {color:#013220}IgniteBinaryCacheQueryTestSuite: JoinPartitionPruningSelfTest.testPartitionTransfer[createWithSql = true] - PASSED{color}
* {color:#013220}IgniteBinaryCacheQueryTestSuite: JoinPartitionPruningSelfTest.testJoinWithReplicated[createWithSql = true] - PASSED{color}
* {color:#013220}IgniteBinaryCacheQueryTestSuite: JoinPartitionPruningSelfTest.testOuterJoin[createWithSql = true] - PASSED{color}
* {color:#013220}IgniteBinaryCacheQueryTestSuite: JoinPartitionPruningSelfTest.testExplicitPartitions[createWithSql = true] - PASSED{color}
* {color:#013220}IgniteBinaryCacheQueryTestSuite: CheckWarnJoinPartitionedTables.joinSameTableWithAnnotationAffinityKeyMapped[join=LEFT JOIN] - PASSED{color}
* {color:#013220}IgniteBinaryCacheQueryTestSuite: JoinQueryEntityPartitionPruningSelfTest.testJoinWithDifferentAffinityFunctions[createWithSql = false] - PASSED{color}
* {color:#013220}IgniteBinaryCacheQueryTestSuite: JoinQueryEntityPartitionPruningSelfTest.testPkAliasJoin[createWithSql = false] - PASSED{color}
... and 26 new tests

{panel}
[TeamCity *--&gt; Run :: All* Results|https://ci.ignite.apache.org/viewLog.html?buildId=6167197&amp;buildTypeId=IgniteTests24Java8_RunAll]

> Setting name in QuerySqlField on affinity field broke affinity awareness in sql.
> --------------------------------------------------------------------------------
>
>                 Key: IGNITE-15263
>                 URL: https://issues.apache.org/jira/browse/IGNITE-15263
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 2.10
>            Reporter: Ivan Daschinsky
>            Assignee: Maksim Timonin
>            Priority: Major
>         Attachments: AffinityKeyTest.java
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> If you set affinity key on sql indexed cache and set aliases to affinity field, i.e. 
> {code:java}
> public static class PersonKey {
>         @QuerySqlField
>         public Integer id;
>         @QuerySqlField(name = "city_id") 
>         @AffinityKeyMapped
>         public Integer cityId;
>         public PersonKey(Integer id, Integer cityId) {
>             this.id = id;
>             this.cityId = cityId;
>         }
> }
> ....
> CacheConfiguration config = new CacheConfiguration<PersonKey, Person>("person")
>                 .setIndexedTypes(PersonKey.class, Person.class)
>                 .setSqlSchema("PUBLIC")
>             );
> {code}
> {{affinityKeyColumn}} calulation fails in {{GridH2Table}} and simply not works as expected.
> {{org.apache.ignite.internal.processors.query.QueryUtils#typeForQueryEntity}} should be fixed to take into account
> aliases and set properly {{affinityKeyColumn}} in descriptor.
> Without aliases all works as expected.
> Reproducer of subj is attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)