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

Evgeny Stanilovsky commented on IGNITE-28374:
---------------------------------------------

> As you indicated, there is no query there.
I don`t understand it, 

{noformat}
assertQuery("select id, name, age, _key from PUBLIC.PERSON where _key >= 
?").withParams(BinaryObject(id=8, name=foo8))
{noformat}
is just rewritten part of test, i think you have understand it, ok copy-paster 
from code, upper is the same as:

{noformat}
            QueryChecker qryChecker = assertQuery(String.format(
                "select id, name, age, _key from PUBLIC.PERSON where _key %s 
?", cmpOp.sql
            ))

{noformat}
If it ok now upper questions still relevant.
thank you !


> Fix SQL select by _key for a composite pk for key class in Calcite engine
> -------------------------------------------------------------------------
>
>                 Key: IGNITE-28374
>                 URL: https://issues.apache.org/jira/browse/IGNITE-28374
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Kirill Tkalenko
>            Assignee: Kirill Tkalenko
>            Priority: Major
>              Labels: ignite-2, ise
>
> IGNITE-28331 successfully fixed selects with "_KEY" for composite primary 
> key, but it still doesn't resolve the issue when the key class is passed as a 
> parameter.
> See todo and issue needs to be fixed in this ticket.
> Research result:
> If convert a POJO to a BinaryObject for the index search boundary, then after 
> retrieving rows from the index, the Calcite filter from the query is applied 
> within the iterator, comparing the key retrieved from the index with the 
> argument passed to the query. This results in a comparison of the 
> BinaryObject with the POJO, which cannot be equal, and therefore such rows 
> are skipped.
> See 
> *org.apache.ignite.internal.processors.query.calcite.exec.rel.ScanTableRowNode#processNextRow*.
> This problem can be fixed, for example, by converting a POJO to a 
> BinaryObject when receiving them as a query argument in method 
> *org.apache.ignite.internal.processors.query.calcite.exec.ExecutionContext#getParameter*.
>  However, this could break the ability to pass POJO to user-defined 
> functions. Perhaps there is a simpler or more elegant solution.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to