You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by "Alexander Paschenko (JIRA)" <ji...@apache.org> on 2017/11/23 09:33:00 UTC
[jira] [Created] (IGNITE-6996) Smarter handling of id fields in SQL
values
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)