fix listagg bug and skip table not exist when process schema stats

This commit is contained in:
wangt1xiuyi
2024-02-29 12:49:50 +00:00
committed by ob-robot
parent 7d826c2eb3
commit a19b3513a5
3 changed files with 13 additions and 9 deletions

View File

@ -6874,6 +6874,9 @@ int ObSelectResolver::check_listagg_aggr_param_valid(ObAggFunRawExpr *aggr_expr)
LOG_WARN("invalid number of arguments", K(ret), KPC(aggr_expr));
} else if (aggr_expr->get_real_param_exprs().at(aggr_expr->get_real_param_count() - 1)->is_const_expr()) {
//do nothing
} else if (aggr_expr->get_real_param_exprs().at(aggr_expr->get_real_param_count() - 1)->has_flag(CNT_AGG)) {
ret = OB_ERR_ARGUMENT_SHOULD_CONSTANT;
LOG_WARN("argument is should be a const expr", K(ret), KPC(aggr_expr));
} else if (OB_FAIL(check_separator_exprs.push_back(aggr_expr->get_real_param_exprs().at(aggr_expr->get_real_param_count() - 1)))) {
LOG_WARN("failed to push back", K(ret));
} else if (get_select_stmt()->get_all_group_by_exprs(all_group_by_exprs)) {

View File

@ -2533,16 +2533,10 @@ int ObRawExprDeduceType::visit(ObWinFunRawExpr &expr)
result_type.set_accuracy(ObAccuracy::MAX_ACCURACY[ObIntType]);
}
expr.set_result_type(result_type);
} else if (OB_FAIL(expr.get_agg_expr()->deduce_type(my_session_))) {
LOG_WARN("deduce type failed", K(ret));
} else {
// agg函数func_params也为空,此时需要置成agg的result_type
if (expr.get_agg_expr()->get_result_type().is_invalid()) {
if (OB_FAIL(expr.get_agg_expr()->deduce_type(my_session_))) {
LOG_WARN("deduce type failed", K(ret));
}
}
if (OB_SUCC(ret)) {
expr.set_result_type(expr.get_agg_expr()->get_result_type());
}
expr.set_result_type(expr.get_agg_expr()->get_result_type());
}
//here pl_agg_udf_expr_ in win_expr must be null, defensive check!!!
} else if (OB_UNLIKELY(expr.get_pl_agg_udf_expr() != NULL)) {