-
Notifications
You must be signed in to change notification settings - Fork 102
Ordering of tuples after orderBy operator
ziyi chen edited this page May 17, 2022
·
1 revision
The ordering of tuples can't be guaranteed after the orderBy operator if we multi-threaded the execution of following opeators.
We defined some rules of the behaviour of operators after orderBy:
- ORDER BY IN RETURN: the ordering of result tuples is preserved.
- ORDER BY IN WITH: Only allow "Top k" type queries with LIMIT and/or SKIP. That is an ORDER BY clause can follow a WITH if and only if there is a LIMIT and/or SKIP following ORDER BY. And if there is a LIMIT and/or SKIP, the LIMIT and SKIP will consume its input/result set according to the given order. But any operator after that ignores the order.
If a query uses ORDER BY IN WITH and is not followed with a LIMIT or SKIP, we error (or we should ignore the ORDER BY clause but ignoring could be harder to do. Erroring is more explicit. Currently, we just make the opeartors after orderby single-threaded.
- Coding Style
- Casting Rules
- Frontend
- Processor
- Storage
- Test