ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Paschenko (JIRA)" <j...@apache.org>
Subject [jira] [Created] (IGNITE-6996) Smarter handling of id fields in SQL values
Date Thu, 23 Nov 2017 09:33:00 GMT
Alexander Paschenko created IGNITE-6996:
-------------------------------------------

             Summary: Smarter handling of id fields in SQL values
                 Key: IGNITE-6996
                 URL: https://issues.apache.org/jira/browse/IGNITE-6996
             Project: Ignite
          Issue Type: Improvement
          Components: sql
            Reporter: Alexander Paschenko


Consider such case:

User wants to have a composite value (many value fields in {{QueryEntity}}) with one field
associated with value's id (most likely matching cache key too).

Currently in order to insert such an object we will have to do something like
{{INSERT INTO Person(_key, id, name) values(1, 1, 'John')}}

And there's no way to avoid such a redundant repeat of the same value.

Suggested approach: I believe that we should specifically handle the case when user specifies
{{keyFieldName}} in configuration and specified field is field of the value.

In such case, we could just do {{INSERT INTO Person(id, name) values(1, 'John')}} and derive
{{_key}} value from {{id}} column. (And vice versa.)

At a glance, this also will require following tweaks:
- forbid performing SQL {{UPDATE}} on such column ({{id}} in above example);
- on an {{INSERT}}, check that {{_key}} and {{id}} values are the same, if both specified.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message