Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Not A Bug
-
Impala 1.4.1
-
None
-
None
-
None
Description
I have the impression that `group_concat` should follow the order of the rows it is aggregating. The documentation[1] does not specify that, but there is a test[2] which states "Use a subquery with an ORDER BY to ensure `group_concat` results are in a deterministic order".
So, when I run the code below[3], I expect to get the result `a, b, c`.
Instead, I get `b, a, c`, which suggests the ORDER BY is having no effect.
Is this a problem with (1) my understanding of how to induce an order, (2) my and the test's expectations – `group_concat` was actually never intended to obey order, or (3) the behavior of `group_concat`?
[3]
select group_concat(name) from ( select * from ( select 'b' as name union all select 'a' as name union all select 'c' as name ) names order by name ) names