mirror of https://github.com/apache/druid.git
Clarify how ORDER BY works with UNION ALL (#10561)
Hopefully a bit clearer.
This commit is contained in:
parent
6ccddedb7a
commit
3436297354
|
@ -167,9 +167,9 @@ together and appear one after the other.
|
|||
|
||||
#### Table-level
|
||||
|
||||
UNION ALL can be used to query multiple tables at the same time. In this case, it must appear in the FROM clause,
|
||||
and the subqueries that are inputs to the UNION ALL operator must be simple table SELECTs (no expressions, column
|
||||
aliasing, etc). The query will run natively using a [union datasource](datasource.md#union).
|
||||
UNION ALL can be used to query multiple tables at the same time. In this case, it must appear in a subquery in the
|
||||
FROM clause, and the lower-level subqueries that are inputs to the UNION ALL operator must be simple table SELECTs
|
||||
(no expressions, column aliasing, etc). The query will run natively using a [union datasource](datasource.md#union).
|
||||
|
||||
The same columns must be selected from each table in the same order, and those columns must either have the same types,
|
||||
or types that can be implicitly cast to each other (such as different numeric types). For this reason, it is generally
|
||||
|
@ -190,7 +190,7 @@ GROUP BY col1
|
|||
|
||||
When UNION ALL occurs at the table level, the rows from the unioned tables are not guaranteed to be processed in
|
||||
any particular order. They may be processed in an interleaved fashion. If you need a particular result ordering,
|
||||
use [ORDER BY](#order-by).
|
||||
use [ORDER BY](#order-by) on the outer query.
|
||||
|
||||
### EXPLAIN PLAN
|
||||
|
||||
|
|
Loading…
Reference in New Issue