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

[jira] [Updated] (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:all-tabpanel ]

Maksim Timonin updated IGNITE-15263:
------------------------------------
    Release Note: Fix setting alias for affinity fields.

> 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
>             Fix For: 2.12
>
>         Attachments: AffinityKeyTest.java
>
>          Time Spent: 50m
>  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.20.1#820001)