fix optimize bugs
This commit is contained in:
@ -370,5 +370,21 @@ int ObLogDistinct::generate_link_sql_pre(GenLinkStmtContext& link_ctx)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ObLogDistinct::check_output_dep_specific(ObRawExprCheckDep &checker)
|
||||||
|
{
|
||||||
|
int ret = OB_SUCCESS;
|
||||||
|
// distinct exprs
|
||||||
|
for (int64_t i = 0; OB_SUCC(ret) && i < distinct_exprs_.count(); ++i) {
|
||||||
|
if (OB_ISNULL(distinct_exprs_.at(i))) {
|
||||||
|
ret = OB_ERR_UNEXPECTED;
|
||||||
|
LOG_WARN("distinct_exprs_.at(i) is null", K(ret), K(i));
|
||||||
|
} else if (OB_FAIL(checker.check(*distinct_exprs_.at(i)))) {
|
||||||
|
LOG_WARN("failed to check distinct_exprs_.at(i)", K(ret), K(i));
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace sql
|
} // namespace sql
|
||||||
} // namespace oceanbase
|
} // namespace oceanbase
|
||||||
|
|||||||
@ -90,6 +90,7 @@ public:
|
|||||||
virtual int allocate_expr_pre(ObAllocExprContext& ctx) override;
|
virtual int allocate_expr_pre(ObAllocExprContext& ctx) override;
|
||||||
virtual int compute_op_ordering() override;
|
virtual int compute_op_ordering() override;
|
||||||
virtual int generate_link_sql_pre(GenLinkStmtContext& link_ctx) override;
|
virtual int generate_link_sql_pre(GenLinkStmtContext& link_ctx) override;
|
||||||
|
virtual int check_output_dep_specific(ObRawExprCheckDep& checker);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
common::ObSEArray<ObRawExpr*, 16, common::ModulePageAllocator, true> distinct_exprs_;
|
common::ObSEArray<ObRawExpr*, 16, common::ModulePageAllocator, true> distinct_exprs_;
|
||||||
|
|||||||
@ -1775,9 +1775,14 @@ int ObLogicalOperator::do_post_traverse_operation(const TraverseOp& op, void* ct
|
|||||||
!static_cast<ObSelectStmt*>(get_stmt())->need_temp_table_trans() &&
|
!static_cast<ObSelectStmt*>(get_stmt())->need_temp_table_trans() &&
|
||||||
!static_cast<ObSelectStmt*>(get_stmt())->is_temp_table() && get_stmt()->has_order_by() &&
|
!static_cast<ObSelectStmt*>(get_stmt())->is_temp_table() && get_stmt()->has_order_by() &&
|
||||||
!get_stmt()->is_order_siblings() && log_op_def::LOG_SORT != top->get_type() &&
|
!get_stmt()->is_order_siblings() && log_op_def::LOG_SORT != top->get_type() &&
|
||||||
AllocExchContext::DistrStat::DISTRIBUTED == alloc_exch_ctx->plan_type_ &&
|
AllocExchContext::DistrStat::DISTRIBUTED == alloc_exch_ctx->plan_type_) {
|
||||||
OB_FAIL(allocate_stmt_order_by_above(top))) {
|
if (OB_FAIL(allocate_stmt_order_by_above(top))) {
|
||||||
LOG_WARN("failed to allocate stmt order by", K(ret));
|
LOG_WARN("failed to allocate stmt order by", K(ret));
|
||||||
|
} else if (OB_FAIL(top->replace_generated_agg_expr(alloc_exch_ctx->group_push_down_replaced_exprs_))) {
|
||||||
|
LOG_WARN("failed to replace generated agg expr", K(ret));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (OB_FAIL(ret)) {
|
||||||
} else if (NULL == top->get_parent()) {
|
} else if (NULL == top->get_parent()) {
|
||||||
// this is the final root operator
|
// this is the final root operator
|
||||||
ObExchangeInfo exch_info;
|
ObExchangeInfo exch_info;
|
||||||
@ -5216,7 +5221,6 @@ int ObLogicalOperator::allocate_dummy_output_access()
|
|||||||
ObLogExchange *exchange_op = NULL;
|
ObLogExchange *exchange_op = NULL;
|
||||||
exchange_op = static_cast<ObLogExchange*>(this);
|
exchange_op = static_cast<ObLogExchange*>(this);
|
||||||
if (exchange_op->get_is_remote() && exchange_op->is_producer()) {
|
if (exchange_op->get_is_remote() && exchange_op->is_producer()) {
|
||||||
// https://work.aone.alibaba-inc.com/issue/33487009
|
|
||||||
// 0. EXCHANGE IN REMOTE
|
// 0. EXCHANGE IN REMOTE
|
||||||
// 1. EXCHANGE OUT REMOTE
|
// 1. EXCHANGE OUT REMOTE
|
||||||
// 2. TABLE SCAN / OTHERS
|
// 2. TABLE SCAN / OTHERS
|
||||||
|
|||||||
Reference in New Issue
Block a user