fix group by with rollup inherit incorrect sharding
This commit is contained in:
@ -832,5 +832,30 @@ int ObLogGroupBy::is_my_fixed_expr(const ObRawExpr *expr, bool &is_fixed)
|
||||
is_fixed = ObOptimizerUtil::find_item(aggr_exprs_, expr) ||
|
||||
(T_FUN_SYS_REMOVE_CONST == expr->get_expr_type() && ObOptimizerUtil::find_item(rollup_exprs_, expr));
|
||||
}
|
||||
return OB_SUCCESS;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObLogGroupBy::compute_sharding_info()
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
if (ObRollupStatus::ROLLUP_COLLECTOR == rollup_adaptive_info_.rollup_status_) {
|
||||
ObLogicalOperator *child = NULL;
|
||||
if (get_num_of_child() == 0) {
|
||||
/*do nothing*/
|
||||
} else if (OB_ISNULL(child = get_child(ObLogicalOperator::first_child))) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("get unexpected null", K(ret));
|
||||
} else if (child->get_strong_sharding() != NULL &&
|
||||
OB_FAIL(weak_sharding_.push_back(child->get_strong_sharding()))) {
|
||||
LOG_WARN("failed to push back weak sharding");
|
||||
} else if (OB_FAIL(append(weak_sharding_, child->get_weak_sharding()))) {
|
||||
LOG_WARN("failed to assign sharding info", K(ret));
|
||||
} else {
|
||||
inherit_sharding_index_ = ObLogicalOperator::first_child;
|
||||
strong_sharding_ = NULL;
|
||||
}
|
||||
} else if (OB_FAIL(ObLogicalOperator::compute_sharding_info())) {
|
||||
LOG_WARN("failed to compute sharding info", K(ret));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
Reference in New Issue
Block a user