Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
大炮V587
oceanbase
提交
bbf81bb5
O
oceanbase
项目概览
大炮V587
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bbf81bb5
编写于
3月 06, 2023
作者:
O
obdev
提交者:
ob-robot
3月 06, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix allocate merge group by with partition sort bug
上级
b21be06c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
7 addition
and
5 deletion
+7
-5
src/sql/optimizer/ob_select_log_plan.cpp
src/sql/optimizer/ob_select_log_plan.cpp
+4
-2
tools/deploy/mysql_test/test_suite/groupby/r/mysql/group_by_basic.result
...sql_test/test_suite/groupby/r/mysql/group_by_basic.result
+3
-3
未找到文件。
src/sql/optimizer/ob_select_log_plan.cpp
浏览文件 @
bbf81bb5
...
...
@@ -332,7 +332,7 @@ int ObSelectLogPlan::candi_allocate_three_stage_group_by(const ObIArray<ObRawExp
is_partition_wise
)))
{
LOG_WARN
(
"failed to check if sharding compatible with distinct expr"
,
K
(
ret
));
}
else
if
(
!
candidate_plan
.
plan_tree_
->
is_distributed
()
||
is_partition_wise
)
{
bool
part_sort_valid
=
!
groupby_helper
.
force_normal_sort_
;
bool
part_sort_valid
=
!
groupby_helper
.
force_normal_sort_
&&
!
group_by_exprs
.
empty
()
;
bool
normal_sort_valid
=
!
groupby_helper
.
force_part_sort_
;
bool
can_ignore_merge_plan
=
!
(
groupby_plans
.
empty
()
||
groupby_helper
.
force_use_merge_
);
if
(
OB_FAIL
(
update_part_sort_method
(
part_sort_valid
,
normal_sort_valid
)))
{
...
...
@@ -931,6 +931,7 @@ int ObSelectLogPlan::create_merge_group_plan(const ObIArray<ObRawExpr*> &reduce_
{
int
ret
=
OB_SUCCESS
;
CandidatePlan
part_sort_mgb_plan
=
candidate_plan
;
bool
can_ignore_no_part_sort_plan
=
can_ignore_merge_plan
;
if
(
part_sort_valid
&&
OB_FAIL
(
inner_create_merge_group_plan
(
reduce_exprs
,
group_by_exprs
,
group_directions
,
...
...
@@ -947,6 +948,7 @@ int ObSelectLogPlan::create_merge_group_plan(const ObIArray<ObRawExpr*> &reduce_
}
else
if
(
part_sort_valid
&&
NULL
!=
part_sort_mgb_plan
.
plan_tree_
&&
OB_FAIL
(
candidate_plans
.
push_back
(
part_sort_mgb_plan
)))
{
LOG_WARN
(
"failed to push merge group by"
,
K
(
ret
));
}
else
if
(
OB_FALSE_IT
(
can_ignore_no_part_sort_plan
|=
part_sort_valid
&&
NULL
!=
part_sort_mgb_plan
.
plan_tree_
))
{
}
else
if
(
normal_sort_valid
&&
OB_FAIL
(
inner_create_merge_group_plan
(
reduce_exprs
,
group_by_exprs
,
group_directions
,
...
...
@@ -958,7 +960,7 @@ int ObSelectLogPlan::create_merge_group_plan(const ObIArray<ObRawExpr*> &reduce_
groupby_helper
,
candidate_plan
.
plan_tree_
,
false
,
can_ignore_
merge
_plan
)))
{
can_ignore_
no_part_sort
_plan
)))
{
LOG_WARN
(
"failed to create merge group by plan"
,
K
(
ret
));
}
else
if
(
normal_sort_valid
&&
NULL
!=
candidate_plan
.
plan_tree_
&&
OB_FAIL
(
candidate_plans
.
push_back
(
candidate_plan
)))
{
...
...
tools/deploy/mysql_test/test_suite/groupby/r/mysql/group_by_basic.result
浏览文件 @
bbf81bb5
...
...
@@ -360,15 +360,15 @@ insert into t1 (c1, c2, c3) values (2, 3, 2);
insert into t1 (c1, c2, c3) values (2, 3, 3);
select c2, avg(distinct c3) from t1 group by c2;
c2 avg(distinct c3)
1 1.5000
2 2.5000
1 1.5000
3 2.5000
select c1,c2, group_concat(distinct c3 order by c3 desc) from t1 group by c1,c2;
c1 c2 group_concat(distinct c3 order by c3 desc)
1 1 1
1 2 3,2
2 1 2
2 3 3,2
2 1 2
1 2 3,2
select c1,c2, group_concat(distinct c3 order by c3 desc) from t1 group by c1,c2 with rollup;
c1 c2 group_concat(distinct c3 order by c3 desc)
1 1 1
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录