You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by "Evgeniy Rudenko (Jira)" <ji...@apache.org> on 2020/01/22 03:59:00 UTC

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

Evgeniy Rudenko created IGNITE-12561:
----------------------------------------

             Summary: 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


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:
 
{color:#172b4d}{{{color:#505f79}// here, you can't query Key.a via SQL{color}{color:#0052cc}class{color} {color:#6554c0}Key{color} { @QuerySqlField {color:#0052cc}int{color} a; @QuerySqlField {color:#0052cc}int{color} b; }{color:#0052cc}class{color} {color:#6554c0}Value{color} { @QuerySqlField {color:#0052cc}int{color} a; @QuerySqlField {color:#0052cc}int{color} c; }}}{color}
To workaround that, one needs to specify a different name for one of the `a` fields:
 
{color:#172b4d}{{{color:#0052cc}class{color} {color:#6554c0}Key{color} { @QuerySqlField(name = {color:#36b37e}"key_a"{color}) {color:#0052cc}int{color} a; @QuerySqlField {color:#0052cc}int{color} b; }{color:#0052cc}class{color} {color:#6554c0}Value{color} { @QuerySqlField {color:#0052cc}int{color} a; @QuerySqlField {color:#0052cc}int{color} c; }}}{color}
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)