github-actions[bot] commented on code in PR #69679:
URL: https://github.com/apache/doris/pull/69679#discussion_r4387798062
##########
be/src/exec/operator/olap_scan_operator.cpp:
##########
@@ -574,15 +572,9 @@ Status
OlapScanLocalState::_should_push_down_function_filter(VectorizedFnCall* f
return Status::OK();
} else {
DCHECK(is_string_type(children[1 -
i]->data_type()->get_primitive_type()));
- std::shared_ptr<ColumnPtrWrapper> const_col_wrapper;
+ std::shared_ptr<ConstantExprResult> const_col_wrapper;
RETURN_IF_ERROR(children[1 - i]->get_const_col(expr_ctx,
&const_col_wrapper));
- if (const auto* const_column =
-
check_and_get_column<ColumnConst>(const_col_wrapper->column_ptr.get())) {
- *constant_str = const_column->get_data_at(0);
- } else {
- pdt = PushDownType::UNACCEPTABLE;
- return Status::OK();
- }
+ *constant_str = const_col_wrapper->column().get_data_at(0);
Review Comment:
[P1] Preserve NULL semantics for newly accepted plain LIKE patterns
With `enable_function_pushdown=true`, a constant `coalesce(...)` can return
a plain `ColumnNullable(String)` containing NULL, which this path previously
rejected. For example, on a duplicate-key table whose VARCHAR key `k` contains
`''`, consider:
```sql
WHERE k LIKE coalesce(
jsonb_extract_string(CAST('{}' AS JSON), '$.x'),
jsonb_extract_string(CAST('{}' AS JSON), '$.y'))
```
The missing paths yield NULL, and `VectorizedCoalesceExpr` caches an
ordinary nullable row. This read produces `{nullptr, 0}`, but accepting it
builds a `LikeColumnPredicate` whose `FunctionLike::construct_like_const_state`
treats it as an empty pattern and selects `constant_equals_fn_scalar`. The
accepted key predicate also removes the residual LIKE expression, so the
empty-key row passes although SQL NULL must reject every row. With the default
FE-only constant folding, the JSON extraction is not folded away. Preserve
expression fallback for a NULL pattern, or explicitly reject all rows, before
admitting it to the storage filter; add a plain-null pattern case. This example
is source-traced, not executed.
--
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]