This sql will failed because
2 in the group by will bind to 1 as col2 in BindExpression
ResolveOrdinalInOrderByAndGroupBy will replace 1 to MIN (LENGTH (cast(age as varchar)))
CheckAnalysis will throw an exception because group by can not contains aggregate function
select MIN (LENGTH (cast(age as varchar))), 1 AS col2
from test_bind_groupby_slots
group by 2
we should move ResolveOrdinalInOrderByAndGroupBy into BindExpression
(cherry picked from commit 3fab4496c3fefe95b4db01f300bf747080bfc3d8)
94 lines
936 B
Plaintext
94 lines
936 B
Plaintext
-- This file is automatically generated. You should know what you did if you want to edit this
|
|
-- !select --
|
|
-3
|
|
-1
|
|
|
|
-- !select --
|
|
a 1
|
|
all 1
|
|
all 2
|
|
|
|
-- !select --
|
|
0
|
|
|
|
-- !bind_sort_scan --
|
|
3
|
|
1
|
|
2
|
|
|
|
-- !bind_sort_alias --
|
|
1
|
|
2
|
|
3
|
|
|
|
-- !bind_sort_aliasAndScan --
|
|
1
|
|
3
|
|
2
|
|
|
|
-- !bind_order_to_project_alias --
|
|
4 5
|
|
5 4
|
|
6 6
|
|
|
|
-- !bind_order_to_project_alias --
|
|
5 4
|
|
4 5
|
|
6 6
|
|
|
|
-- !having_bind_child --
|
|
1 10
|
|
|
|
-- !having_bind_child2 --
|
|
2 10
|
|
|
|
-- !having_bind_child3 --
|
|
2 10
|
|
|
|
-- !having_bind_project --
|
|
2 10
|
|
|
|
-- !having_bind_project2 --
|
|
|
|
-- !having_bind_project3 --
|
|
|
|
-- !having_bind_project4 --
|
|
2 11
|
|
|
|
-- !having_bind_child4 --
|
|
2 11
|
|
|
|
-- !having_bind_child5 --
|
|
2 11
|
|
|
|
-- !having_bind_agg_fun --
|
|
|
|
-- !having_bind_agg_fun --
|
|
2 4
|
|
3 3
|
|
|
|
-- !having_bind_group_by --
|
|
7 3
|
|
|
|
-- !having_bind_group_by --
|
|
7 3
|
|
|
|
-- !having_bind_group_by --
|
|
7 3
|
|
|
|
-- !having_bind_group_by --
|
|
4 5 3
|
|
|
|
-- !having_bind_group_by --
|
|
1 2
|
|
|
|
-- !having_bind_group_by --
|
|
2 1
|
|
|
|
-- !sql --
|
|
2 1
|
|
|
|
-- !sql --
|
|
2 1
|
|
|