This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-4.0 by this push:
new 76073b41b7d branch-4.0: [fix](core)Fix a DCHECK failure when
short-circuit evaluation and array_map are used together. #60693 (#60800)
76073b41b7d is described below
commit 76073b41b7d0c84cb03ec0cfff934f415a6956c6
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Feb 24 13:29:37 2026 +0800
branch-4.0: [fix](core)Fix a DCHECK failure when short-circuit evaluation
and array_map are used together. #60693 (#60800)
Cherry-picked from #60693
Co-authored-by: Mryange <[email protected]>
---
be/src/vec/exprs/lambda_function/varray_map_function.cpp | 4 +++-
.../conditional_functions/test_short_circuit_evaluation.out | 7 +++++++
.../conditional_functions/test_short_circuit_evaluation.groovy | 9 +++++++++
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/be/src/vec/exprs/lambda_function/varray_map_function.cpp
b/be/src/vec/exprs/lambda_function/varray_map_function.cpp
index db9c2dd20af..94e72b90dfb 100644
--- a/be/src/vec/exprs/lambda_function/varray_map_function.cpp
+++ b/be/src/vec/exprs/lambda_function/varray_map_function.cpp
@@ -285,7 +285,9 @@ public:
//3. child[0]->execute(new_block)
ColumnPtr res_col;
- RETURN_IF_ERROR(children[0]->execute_column(context,
&lambda_block, expr_selector,
+ // lambda body executes on the internal lambda_block, not the
original block.
+ // The outer expr_selector is irrelevant here, so pass nullptr.
+ RETURN_IF_ERROR(children[0]->execute_column(context,
&lambda_block, nullptr,
lambda_block.rows(),
res_col));
res_col = res_col->convert_to_full_column_if_const();
res_type = children[0]->execute_type(&lambda_block);
diff --git
a/regression-test/data/query_p0/sql_functions/conditional_functions/test_short_circuit_evaluation.out
b/regression-test/data/query_p0/sql_functions/conditional_functions/test_short_circuit_evaluation.out
index 859669acfa3..ec86c28b679 100644
---
a/regression-test/data/query_p0/sql_functions/conditional_functions/test_short_circuit_evaluation.out
+++
b/regression-test/data/query_p0/sql_functions/conditional_functions/test_short_circuit_evaluation.out
@@ -383,3 +383,10 @@
9 9 -2 i i unknown
10 10 100 j t no
+-- !with_array_map --
+\N
+\N
+\N
+[9, 9, 9]
+[16, 16, 16]
+
diff --git
a/regression-test/suites/query_p0/sql_functions/conditional_functions/test_short_circuit_evaluation.groovy
b/regression-test/suites/query_p0/sql_functions/conditional_functions/test_short_circuit_evaluation.groovy
index e996a74192d..229ee604367 100644
---
a/regression-test/suites/query_p0/sql_functions/conditional_functions/test_short_circuit_evaluation.groovy
+++
b/regression-test/suites/query_p0/sql_functions/conditional_functions/test_short_circuit_evaluation.groovy
@@ -655,4 +655,13 @@ suite("test_short_circuit_evaluation") {
// Clean up
sql "DROP TABLE IF EXISTS test_short_circuit_eval;"
+
+
+ sql """
+ set short_circuit_evaluation = true;
+ """
+
+ qt_with_array_map"""
+ select if(number < 3 , null, array_map(x -> x * x,
array(number,number,number))) from numbers("number" = "5");
+ """
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]