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

Reza Taroosheh commented on IGNITE-29191:
-----------------------------------------

[~zstan], [~timonin.maksim], could you please review the fix? PR: 
https://github.com/apache/ignite/pull/13735
The release note has been added.

>  Local IndexQuery ignores setLimit()
> ------------------------------------
>
>                 Key: IGNITE-29191
>                 URL: https://issues.apache.org/jira/browse/IGNITE-29191
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Reza Taroosheh
>            Assignee: Reza Taroosheh
>            Priority: Major
>             Fix For: 2.19
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> h3. Summary
> {{IndexQuery#setLimit}} is applied to a distributed query, but a query run 
> with {{setLocal(true)}} returns every matching row.
> A user reported this on the dev list, with a reproducer. Reproduces on 2.17, 
> 2.18, and current master.
> h3. Steps
> A REPLICATED cache with 10,000 rows, and an {{IndexQuery}} with 
> {{setLimit(3)}} and {{{}setLocal(true){}}}:
> {code:java}
> IndexQuery<Long, Person> qry = new IndexQuery<Long, Person>(Person.class, 
> IDX).setLimit(3);
> qry.setLocal(true);
> assertEquals(3, crd.cache(CACHE).query(qry).getAll().size());
> {code}
> *Expected:* 3 rows.
> *Actual:* {{expected:<3> but was:<10000>}}
> h3. Cause
> {{IgniteCacheProxyImpl#query}} passes the limit to the {{CacheQuery}} for 
> both paths. The distributed path applies it in 
> {{{}GridCacheQueryFutureAdapter{}}}, but the local path, 
> {{{}GridCacheQueryManager#indexQueryLocal{}}}, never reads 
> {{{}qry.limit(){}}}.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to