Make white filter compat with former

This commit is contained in:
DengzhiLiu
2023-11-29 03:41:38 +00:00
committed by ob-robot
parent d5694c46f2
commit ec99435d53
2 changed files with 30 additions and 12 deletions

View File

@ -184,6 +184,7 @@ public:
bool is_root_job = true);
inline static void exprs_not_support_vectorize(const ObIArray<ObRawExpr *> &exprs,
bool &found);
inline uint64_t get_cur_cluster_version() { return cur_cluster_version_; }
// detect physical operator type from logic operator.
static int get_phy_op_type(ObLogicalOperator &op, ObPhyOperatorType &type,
@ -507,7 +508,6 @@ private:
|| T_FUN_SUM == expr_type
|| T_FUN_MAX == expr_type
|| T_FUN_MIN == expr_type; }
uint64_t get_cur_cluster_version() { return cur_cluster_version_; }
int check_fk_nested_dup_del(const uint64_t table_id,
const uint64_t root_table_id,
DASTableIdList &parent_tables,

View File

@ -261,17 +261,35 @@ int ObPushdownFilterConstructor::is_white_mode(const ObRawExpr* raw_expr, bool &
}
need_check = false;
} else {
const ObExprResType &col_type = child->get_result_type();
for (int64_t i = 1; OB_SUCC(ret) && need_check && i < raw_expr->get_param_count(); i++) {
if (OB_ISNULL(child = raw_expr->get_param_expr(i))) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("Unexpected null child expr", K(ret), K(i));
} else {
const ObExprResType &param_type = child->get_result_type();
need_check = child->is_const_expr();
if (need_check && !param_type.is_null()) {
const ObCmpOp cmp_op = sql::ObRelationalExprOperator::get_cmp_op(raw_expr->get_expr_type());
need_check = sql::ObRelationalExprOperator::can_cmp_without_cast(col_type, param_type, cmp_op);
if (static_cg_.get_cur_cluster_version() < CLUSTER_VERSION_4_3_0_0) {
const ObObjMeta &col_meta = child->get_result_meta();
for (int64_t i = 1; OB_SUCC(ret) && need_check && i < raw_expr->get_param_count(); i++) {
if (OB_ISNULL(child = raw_expr->get_param_expr(i))) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("Unexpected null child expr", K(ret), K(i));
} else {
const ObObjMeta &param_meta = child->get_result_meta();
need_check = child->is_const_expr();
if (need_check && !param_meta.is_null()) {
const ObCmpOp cmp_op = sql::ObRelationalExprOperator::get_cmp_op(raw_expr->get_expr_type());
obj_cmp_func cmp_func = nullptr;
need_check = ObObjCmpFuncs::can_cmp_without_cast(col_meta, param_meta, cmp_op, cmp_func);
}
}
}
} else {
const ObExprResType &col_type = child->get_result_type();
for (int64_t i = 1; OB_SUCC(ret) && need_check && i < raw_expr->get_param_count(); i++) {
if (OB_ISNULL(child = raw_expr->get_param_expr(i))) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("Unexpected null child expr", K(ret), K(i));
} else {
const ObExprResType &param_type = child->get_result_type();
need_check = child->is_const_expr();
if (need_check && !param_type.is_null()) {
const ObCmpOp cmp_op = sql::ObRelationalExprOperator::get_cmp_op(raw_expr->get_expr_type());
need_check = sql::ObRelationalExprOperator::can_cmp_without_cast(col_type, param_type, cmp_op);
}
}
}
}