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:35:00 UTC
[jira] [Comment Edited] (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 edited comment on IGNITE-14120 at 2/26/21, 8:34 AM:
------------------------------------------------------------------------------
Hi [~nifeng2xing]
I conducted a query test according to the configuration in the question. No matter how many nodes are queried, whether it is primary key or non primary key, the result is correct.
But I can still offer some ideas.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.
was (Author: xin.chang):
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)