yiguolei commented on code in PR #39637:
URL: https://github.com/apache/doris/pull/39637#discussion_r1726837643
##########
be/src/pipeline/exec/scan_operator.cpp:
##########
@@ -530,23 +532,23 @@ bool
ScanLocalState<Derived>::_ignore_cast(SlotDescriptor* slot, vectorized::VEx
return false;
}
+// Used to handle constant expressions, such as '1 = 1' _eval_const_conjuncts
does not handle cases like 'colA = 1'.
+// When a null value or false value is computed, considering that the
conjuncts are connected by AND, an empty set can be returned immediately.
template <typename Derived>
Status ScanLocalState<Derived>::_eval_const_conjuncts(vectorized::VExpr* vexpr,
vectorized::VExprContext* expr_ctx,
PushDownType* pdt) {
- char* constant_val = nullptr;
if (vexpr->is_constant()) {
std::shared_ptr<ColumnPtrWrapper> const_col_wrapper;
RETURN_IF_ERROR(vexpr->get_const_col(expr_ctx, &const_col_wrapper));
- if (const vectorized::ColumnConst* const_column =
+ if (const auto* const_column =
check_and_get_column<vectorized::ColumnConst>(const_col_wrapper->column_ptr)) {
- constant_val =
const_cast<char*>(const_column->get_data_at(0).data);
- if (constant_val == nullptr ||
!*reinterpret_cast<bool*>(constant_val)) {
+ if (const_column->is_null_at(0) || !const_column->get_bool(0)) {
*pdt = PushDownType::ACCEPTABLE;
_eos = true;
_scan_dependency->set_ready();
}
- } else if (const vectorized::ColumnVector<vectorized::UInt8>*
bool_column =
Review Comment:
这种没什么意义的改动不要做,以后pick 代码很麻烦。
都是一些个人编程习惯的改动,意义不大。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]