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

Ivan Daschinsky commented on IGNITE-22993:
------------------------------------------

[~nizhikov] Aсtually, it is expected behavior for H2 and Calcite engines. 
Javadoc should be updated  accordingly. This option is thought to be used for 
reducing amount of participated nodes in query for performance benefits. 
Similar to "local" flag. Actually, a simple scan over any replicated cache is 
to be executed on only local node. 

> Count from REPLICATED caches with partition filter
> --------------------------------------------------
>
>                 Key: IGNITE-22993
>                 URL: https://issues.apache.org/jira/browse/IGNITE-22993
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Nikolay Izhikov
>            Priority: Major
>              Labels: calcite, ise
>
> Case when SQL query `SELECT COUNT(*) FROM T` with partitions invoked for 
> REPLICATED cache data don't work properly.
> {code:java}
> /** */
> public class QueryWithPartitionsIntegration2Test extends 
> GridCommonAbstractTest {
>     /** {@inheritDoc} */
>     @Override protected IgniteConfiguration getConfiguration(String 
> igniteInstanceName) throws Exception {
>         IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
>         cfg.getSqlConfiguration().setQueryEnginesConfiguration(new 
> CalciteQueryEngineConfiguration());
>         return cfg;
>     }
>     /** */
>     @Test
>     public void testSelectCount() throws Exception {
>         startGrid(0).createCache(DEFAULT_CACHE_NAME);
>         sql("CREATE TABLE T(ID INT PRIMARY KEY, IDX_VAL VARCHAR, VAL VARCHAR) 
> WITH template=replicated");
>         StringBuilder sb = new StringBuilder("INSERT INTO T(ID, IDX_VAL, VAL) 
> VALUES ");
>         int cnt = 10_000;
>         for (int i = 0; i < cnt; ++i) {
>             if (i != 0)
>                 sb.append(",");
>             sb.append("(").append(i).append(", ")
>                 .append("'name_").append(i).append("', ")
>                 .append("'name_").append(i).append("')");
>         }
>         sql(sb.toString());
>         assertEquals((long)cnt, sql("SELECT COUNT(*) FROM T").get(0).get(0));
>         assertNotEquals((long)cnt, sql("SELECT COUNT(*) FROM T", 
> 42).get(0).get(0));
>     }
>     /** */
>     public List<List<?>> sql(String sqlText, int... parts) {
>         SqlFieldsQuery qry = new SqlFieldsQuery(sqlText).setTimeout(5, 
> TimeUnit.SECONDS);
>         if (!F.isEmpty(parts))
>             qry.setPartitions(parts);
>         return 
> grid(0).cache(F.first(grid(0).cacheNames())).query(qry).getAll();
>     }
> }
> {code}



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

Reply via email to