[
https://issues.apache.org/jira/browse/IGNITE-5188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16040663#comment-16040663
]
Vladimir Ozerov commented on IGNITE-5188:
-----------------------------------------
[~al.psc], my comments:
1) I made some changes to mapper to avoid unnecessary calls to potentially
expensive methods of binary API.
2) Please confirm that we have tests for all parsing negative tests cases: aff
field is not a key field, bad quotes, aff field is not found, etc..
> Support AFFINITY KEY keyword for CREATE TABLE command
> -----------------------------------------------------
>
> Key: IGNITE-5188
> URL: https://issues.apache.org/jira/browse/IGNITE-5188
> Project: Ignite
> Issue Type: Task
> Components: sql
> Reporter: Vladimir Ozerov
> Assignee: Alexander Paschenko
> Fix For: 2.1
>
>
> We need to be able to specify affinity key for cache created through {{CREATE
> TABLE}} command to support data co-location properly. It seems that correct
> way to support this is as follows:
> 1) We need to define special SQL affinity mapper which will accept type name
> and field name.
> 2) Mapper logic: if type name matches, then get affinity field. Otherwise
> return the whole object.
> 3) Performance consideration: we should avoid string comparisons. Instead, we
> should resolve type name to type ID on first access, and then compare only
> IDs.
> 4) We should fix on how we obtain affinity key for type descriptor in
> {{QueryUtils.typeForQueryEntity}} - we should try consulting to special SQL
> mapper first, if it is defined.
> 5) Last (hopefully), we should make sure that affinity routing is not broken.
> See {{GridH2Table.ctor}} - here we should rely on existing affinity column
> from SQL mapper if one is defined.
>
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)