[CP] fix rollup const expr bug

This commit is contained in:
zzg19950727
2023-02-09 16:28:02 +00:00
committed by ob-robot
parent 6e5c95d6b0
commit e85c29835a
2 changed files with 20 additions and 0 deletions

View File

@ -549,6 +549,25 @@ int ObLogGroupBy::print_used_hint(PlanText &plan_text)
return ret;
}
int ObLogGroupBy::compute_const_exprs()
{
int ret = OB_SUCCESS;
ObLogicalOperator *child = NULL;
if (OB_ISNULL(my_plan_) || OB_UNLIKELY(get_num_of_child() < 0)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("operator is invalid", K(ret), K(get_num_of_child()), K(my_plan_));
} else if (OB_ISNULL(child = get_child(0))) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("child is null", K(ret), K(child));
} else if (!has_rollup() &&
OB_FAIL(append(get_output_const_exprs(), child->get_output_const_exprs()))) {
LOG_WARN("failed to append exprs", K(ret));
} else if (OB_FAIL(ObOptimizerUtil::compute_const_exprs(get_filter_exprs(), get_output_const_exprs()))) {
LOG_WARN("failed to compute const conditionexprs", K(ret));
} else {/*do nothing*/}
return ret;
}
int ObLogGroupBy::compute_fd_item_set()
{
int ret = OB_SUCCESS;

View File

@ -144,6 +144,7 @@ public:
{ return (MERGE_AGGREGATE != get_algo() && !is_adaptive_aggregate())
|| ObRollupStatus::ROLLUP_DISTRIBUTOR == rollup_adaptive_info_.rollup_status_; }
virtual int compute_const_exprs() override;
virtual int compute_fd_item_set() override;
virtual int compute_op_ordering() override;
double get_distinct_card() const { return distinct_card_; }