[ 
https://issues.apache.org/jira/browse/IGNITE-10645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16746170#comment-16746170
 ] 

Pavel Kuznetsov commented on IGNITE-10645:
------------------------------------------

[~vozerov] This check was added because I've simplified condition 
(https://github.com/apache/ignite/pull/5657/commits/bed7b76ade5990f4392e1169b060ef82dc67f3fe
 but note that comment would change one more time). If key is of sql type, we 
put it itself into the cache. As we discussed, key itself is not a key field, 
so isKeyField value in this case should be false. We relied on this fact in the 
jdbc metadata for example. If we duplicate keyFieldName in the list of 
keyFields then isKeyField value of the binary property will be true.

Keeping in mind that configuration, having both keyFieldName and keyFields is 
contradictory, I forbid it. 
Other options:
1) Return old condition
2) Start thinking that key object itself is a keyField. Even more - start 
building KeyValueProperty for this field instead of BinaryProperty.  

> SQL properties ownership flag should be set at configuration parsing, not 
> query execution.
> ------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-10645
>                 URL: https://issues.apache.org/jira/browse/IGNITE-10645
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>            Reporter: Pavel Kuznetsov
>            Assignee: Pavel Kuznetsov
>            Priority: Major
>             Fix For: 2.8
>
>
> At processing time, query entities are transformed and validated, table 
> descriptors with properties are created.
> Now in some case (thre's no keyFields and key is of complex non-sql type), 
> ownership flag of query property is calculated at execution time (for example 
> at first put()): 
> https://github.com/apache/ignite/blob/dcdb27a24a450f63487290360b265e1570534629/modules/core/src/main/java/org/apache/ignite/internal/processors/query/property/QueryBinaryProperty.java#L132
> So we can't access metadata, that uses this not-yet-initialized field before 
> we put the data.
> But we already have all necessary info to set this field at processing time.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to