Consider the following example:
SELECT k FROM (SELECT materialize('foo') AS k, -1 AS v) ORDER BY abs(v) AS _v ASC LIMIT 1 BY k
The problem here is that in case of query has LIMIT BY for
WithMergeableState* (which is the final state on the remote shard for
distributd queries) it returns the following columns:
- k
- v
While it should return:
- k
- abs(v)
So as query w/o LIMIT BY, so that initiator will be able to do the sorting
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>