This is an automated email from the ASF dual-hosted git repository.
gian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git
The following commit(s) were added to refs/heads/master by this push:
new 3436297 Clarify how ORDER BY works with UNION ALL (#10561)
3436297 is described below
commit 34362973549d976f479422b8b2732a43e3654160
Author: Gian Merlino <[email protected]>
AuthorDate: Thu Nov 5 20:12:03 2020 -0800
Clarify how ORDER BY works with UNION ALL (#10561)
Hopefully a bit clearer.
---
docs/querying/sql.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/querying/sql.md b/docs/querying/sql.md
index 8613972..a46b4b1 100644
--- a/docs/querying/sql.md
+++ b/docs/querying/sql.md
@@ -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
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]