Reza Taroosheh created IGNITE-29191:
---------------------------------------
Summary: 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
Fix For: 2.19
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
(v8.20.10#820010)