Skip to content

Commit

Permalink
docs: blurb about msq union all (apache#15223)
Browse files Browse the repository at this point in the history
(cherry picked from commit 8769541)
  • Loading branch information
317brian committed Oct 31, 2023
1 parent d3fad8f commit f7cc075
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions docs/querying/sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,7 @@ UNION ALL
SELECT COUNT(*) FROM tbl WHERE my_column = 'value2'
```

:::info
With top-level queries, you can't apply GROUP BY, ORDER BY, or any other operator to the results of a UNION ALL.
:::
Certain limitations apply when you use a top-level UNION ALL. For all top-level UNION ALL queries, you can't apply a GROUP BY, ORDER BY, or any other operator to the results of the query. For any top-level UNION ALL that uses the MSQ task engine, the SQL planner attempts to plan the top-level UNION ALL as a table-level UNION ALL. Because of this, UNION ALL queries that use the MSQ task engine always behave the same as table-level UNION ALL queries. They have the same characteristics and limitations. If the planner can't plan the query as a table-level UNION ALL, the query fails.

### Table-level

Expand Down

0 comments on commit f7cc075

Please sign in to comment.