Using SORT BY and ORDER BY

classic Classic list List threaded Threaded
5 messages Options
Surkov.Aleksandr Surkov.Aleksandr
Reply | Threaded
Open this post in threaded view
|

Using SORT BY and ORDER BY

The org.apache.ignite.internal.processors.cache.query.CacheQuery interface
has a comment:

 *         {@code Group by} and {@code sort by} statements are applied
separately
 *         on each node, so result set will likely be incorrectly grouped or
sorted
 *         after results from multiple remote nodes are grouped together.
 
As far as I understand:
1. {@code sort by} does not supported
2. ORDER BY returns a sorted list even if items are on different nodes

It is right?



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ilya.kasnacheev ilya.kasnacheev
Reply | Threaded
Open this post in threaded view
|

Re: Using SORT BY and ORDER BY

Hello!

1. I guess it is a honest mistake.
2. The idea here is that you can't expect that GROUP BY COL will return anything relevant, if the table is not collocated by COL.

Regards,
--
Ilya Kasnacheev


пт, 10 июл. 2020 г. в 17:34, Surkov.Aleksandr <[hidden email]>:
The org.apache.ignite.internal.processors.cache.query.CacheQuery interface
has a comment:

 *         {@code Group by} and {@code sort by} statements are applied
separately
 *         on each node, so result set will likely be incorrectly grouped or
sorted
 *         after results from multiple remote nodes are grouped together.

As far as I understand:
1. {@code sort by} does not supported
2. ORDER BY returns a sorted list even if items are on different nodes

It is right?



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Surkov.Aleksandr Surkov.Aleksandr
Reply | Threaded
Open this post in threaded view
|

Re: Using SORT BY and ORDER BY

Surkov.Aleksandr Surkov.Aleksandr
Reply | Threaded
Open this post in threaded view
|

Re: Using SORT BY and ORDER BY

In reply to this post by ilya.kasnacheev
There is the question. It turns out that I need to collocate the table,
because the field COL will have different values?
But how can i do this?



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ilya.kasnacheev ilya.kasnacheev
Reply | Threaded
Open this post in threaded view
|

Re: Using SORT BY and ORDER BY

Hello!

By putting your affinity column in the public key of all tables and issuing WITH "affinity_key=<column name>" clause when creating table.


Regards,
--
Ilya Kasnacheev


пт, 10 июл. 2020 г. в 18:32, Surkov.Aleksandr <[hidden email]>:
There is the question. It turns out that I need to collocate the table,
because the field COL will have different values?
But how can i do this?



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/