You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Andrey Mashenkov (Jira)" <ji...@apache.org> on 2020/02/03 10:51:00 UTC

[jira] [Updated] (IGNITE-12561) Add a check for conflict of field names in key and value

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

Andrey Mashenkov updated IGNITE-12561:
--------------------------------------
    Description: 
If key and value types of an SQL-enabled cache have the same fields annotated with `@QuerySqlEntity` the cache will start without errors but the key's field will not be queryable:
{noformat}
// here, you can't query Key.a via SQL
class Key {
   @QuerySqlField int a; 
   @QuerySqlField int b; 
}
class Value { 
   @QuerySqlField int a;
   @QuerySqlField int c;
}
{noformat}
 

To workaround that, one needs to specify a different name for one of the `a` fields: 
{noformat}
class Key {
   @QuerySqlField(name = "key_a") int a;
   @QuerySqlField int b; 
}
class Value {
   @QuerySqlField int a; 
   @QuerySqlField int c;
}
{noformat}
The first configuration is obviously incorrect - one can't use the `Key.a` in SQL but annotates it as queryable. We need to issue an error or at least a warning for starting a configuration like this.

  was:
If key and value types of an SQL-enabled cache have the same fields annotated with `@QuerySqlEntity` the cache will start without errors but the key's field will not be queryable:
  

 
{noformat}
// here, you can't query Key.a via SQL
class Key {
   @QuerySqlField int a; 
   @QuerySqlField int b; 
}
class Value { 
   @QuerySqlField int a;
   @QuerySqlField int c;
}
{noformat}
To workaround that, one needs to specify a different name for one of the `a` fields:
 

 
{noformat}
class Key {
   @QuerySqlField(name = "key_a") int a;
   @QuerySqlField int b; 
}
class Value {
   @QuerySqlField int a; 
   @QuerySqlField int c;
}
{noformat}

 The first configuration is obviously incorrect - one can't use the `Key.a` in SQL but annotates it as queryable. We need to issue an error or at least a warning for starting a configuration like this.


> Add a check for conflict of field names in key and value
> --------------------------------------------------------
>
>                 Key: IGNITE-12561
>                 URL: https://issues.apache.org/jira/browse/IGNITE-12561
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>            Reporter: Evgeniy Rudenko
>            Assignee: Evgeniy Rudenko
>            Priority: Major
>
> If key and value types of an SQL-enabled cache have the same fields annotated with `@QuerySqlEntity` the cache will start without errors but the key's field will not be queryable:
> {noformat}
> // here, you can't query Key.a via SQL
> class Key {
>    @QuerySqlField int a; 
>    @QuerySqlField int b; 
> }
> class Value { 
>    @QuerySqlField int a;
>    @QuerySqlField int c;
> }
> {noformat}
>  
> To workaround that, one needs to specify a different name for one of the `a` fields: 
> {noformat}
> class Key {
>    @QuerySqlField(name = "key_a") int a;
>    @QuerySqlField int b; 
> }
> class Value {
>    @QuerySqlField int a; 
>    @QuerySqlField int c;
> }
> {noformat}
> The first configuration is obviously incorrect - one can't use the `Key.a` in SQL but annotates it as queryable. We need to issue an error or at least a warning for starting a configuration like this.



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