Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Duplicate
-
Impala 2.0
-
None
Description
Impala doesnt apply ORDER BY to queries that contain a UNION. (A warning with that info is shown to the user.) On postgres, mysql, and oracle, the ORDER BY is applied. It would be great if impala would also apply the ordering to be consistent.
Impala:
[localhost:21000] > select smallint_col_3 from table_1 union select bigint_col_2 from table_2 order by 1; ... | 295 | | -151 | | 462 | | -896 | +----------------+ Returned 2002 row(s) in 1.27s WARNINGS: Ignoring ORDER BY clause without LIMIT or OFFSET: ORDER BY 1 ASC .An ORDER BY without a LIMIT or OFFSET appearing in an (inline) view, union operand or an INSERT/CTAS statement has no effect on the query result.
Oracle:
SQL> select 1 from dual union select 2 from dual order by 1 desc; 1 ---------- 2 1
Attachments
Issue Links
- is duplicated by
-
IMPALA-4741 ORDER BY behavior with UNION is incorrect
- Open