You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "xin.chang@intotech.com.cn (Jira)" <ji...@apache.org> on 2021/02/26 08:06:00 UTC

[jira] [Commented] (IGNITE-14120) select count * returns multiple rows

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

xin.chang@intotech.com.cn commented on IGNITE-14120:
----------------------------------------------------

Hi  [~nifeng2xing]

If you have more than one nodes and sqlFieldsQuery.setCollocated (true), then each node will return the query result.

e.g.

 
{code:java}
SqlFieldsQuery query=new SqlFieldsQuery("select count(*) from \"query\".MESSAGE where ID=0");
query.setCollocated(true);
{code}
 

It will return as many results as the number of nodes.But there is no difference between querying primary key and non primary key.

> select count * returns multiple rows
> ------------------------------------
>
>                 Key: IGNITE-14120
>                 URL: https://issues.apache.org/jira/browse/IGNITE-14120
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 2.8.1
>            Reporter: Isaac Zhu
>            Priority: Major
>
> I have a partitioned table which has 1 backup, the *queryParallelism* is set to 4.
> The table primary key is column "ID", 
> If I do this query:
>         select count( * ) from my_table where ID = 1000;
> It will return 4 rows:
>         1
>          0
>          0
>          0
>  
> If I query by other not primary-key columns of this table, the result is good, like:
>         select count( *) from my_table where name = 'abcd'
> result is:
>         0



--
This message was sent by Atlassian Jira
(v8.3.4#803005)