提交 bda57762 编写于 作者: O obdev 提交者: wangzelin.wzl

[3.1_opensource_release] partition.ob_partition_bug43954576

上级 92bf44d2
...@@ -433,32 +433,16 @@ int ObExprCalcPartitionId::calc_opt_route_hash_one(const ObExpr& expr, ObEvalCtx ...@@ -433,32 +433,16 @@ int ObExprCalcPartitionId::calc_opt_route_hash_one(const ObExpr& expr, ObEvalCtx
LOG_WARN("part expr evaluate failed", K(ret)); LOG_WARN("part expr evaluate failed", K(ret));
} else { } else {
int64_t value = 0; int64_t value = 0;
ObObjType input_type = expr.args_[0]->datum_meta_.type_;
if (datum->is_null()) { if (datum->is_null()) {
// do nothing // do nothing
} else if (OB_UNLIKELY(ObIntTC != ob_obj_type_class(input_type)
&& ObUIntTC != ob_obj_type_class(input_type))) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("type is wrong", K(ret), K(*datum));
} else { } else {
switch (ob_obj_type_class(expr.args_[0]->datum_meta_.type_)) { value = (ObIntTC == ob_obj_type_class(input_type))
case ObIntTC: { ? datum->get_int() : static_cast<int64_t>(datum->get_uint64());
value = datum->get_int();
break;
}
case ObUIntTC: {
value = static_cast<int64_t>(datum->get_uint());
break;
}
case ObBitTC: {
value = static_cast<int64_t>(datum->get_bit());
break;
}
case ObYearTC: {
value = static_cast<int64_t>(datum->get_year());
break;
}
default: {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("type is wrong", K(ret), K(expr.args_[0]->datum_meta_.type_));
break;
}
}
if (OB_SUCC(ret)) { if (OB_SUCC(ret)) {
if (OB_UNLIKELY(INT64_MIN == value)) { if (OB_UNLIKELY(INT64_MIN == value)) {
value = INT64_MAX; value = INT64_MAX;
...@@ -466,7 +450,7 @@ int ObExprCalcPartitionId::calc_opt_route_hash_one(const ObExpr& expr, ObEvalCtx ...@@ -466,7 +450,7 @@ int ObExprCalcPartitionId::calc_opt_route_hash_one(const ObExpr& expr, ObEvalCtx
value = value < 0 ? -value : value; value = value < 0 ? -value : value;
} }
} else { } else {
LOG_WARN("Failed to get value", K(ret)); LOG_WARN("Failed to get value", K(ret), K(*datum));
} }
} }
if (OB_FAIL(ret)) { if (OB_FAIL(ret)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册