You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Prasad Bhalerao <pr...@gmail.com> on 2020/06/12 18:44:13 UTC

I am executing following SQL in ignite. As you can see there is no order by
clause in this SQL. Index is present on field name "id".

SqlFieldsQuery sql = new SqlFieldsQuery("select p.id. p.name from Person p
join table(id bigint = ?) i on p.id = i.id.") .setArgs(new
Object[]{5,4,1,7,3});


What I have observed is ignite always returns query result in an order as
it is provided in input.
E.g. I always get resultant rows in following order. This behaviour is
consistent.
p.id.    p.name
5            test5
4           Test4
1            Test1
7            Test7
3             Test3

If I change input "id" sequence, the output changes as per the id sequence
provided.

Can someone please confirm this behaviour?

Also, will it remain same with calcite integration?

Re:

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

I do not recommend relying on this order. It may change if you have more
than one node. It can also change without warning.

Regards,
-- 
Ilya Kasnacheev


пт, 12 июн. 2020 г. в 21:44, Prasad Bhalerao <pr...@gmail.com>:

> I am executing following SQL in ignite. As you can see there is no order
> by clause in this SQL. Index is present on field name "id".
>
> SqlFieldsQuery sql = new SqlFieldsQuery("select p.id. p.name from Person
> p join table(id bigint = ?) i on p.id = i.id.") .setArgs(new
> Object[]{5,4,1,7,3});
>
>
> What I have observed is ignite always returns query result in an order as
> it is provided in input.
> E.g. I always get resultant rows in following order. This behaviour is
> consistent.
> p.id.    p.name
> 5            test5
> 4           Test4
> 1            Test1
> 7            Test7
> 3             Test3
>
> If I change input "id" sequence, the output changes as per the id sequence
> provided.
>
> Can someone please confirm this behaviour?
>
> Also, will it remain same with calcite integration?
>
>
>