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 fbf92f36169 branch-4.0: [fix](In-predicate) fix bug for In-predicate,
when in predicate contains both SlotRef and Constant #60302 (#60316)
fbf92f36169 is described below
commit fbf92f3616948ec930fb61443cd5ff9ac96b644e
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Jan 28 20:23:43 2026 +0800
branch-4.0: [fix](In-predicate) fix bug for In-predicate, when in predicate
contains both SlotRef and Constant #60302 (#60316)
Cherry-picked from #60302
Co-authored-by: minghong <[email protected]>
---
be/src/vec/exprs/vin_predicate.cpp | 3 +-
.../data/query_p0/in_predicate/inPredicate.out | 4 ++
.../query_p0/in_predicate/inPredicate.groovy | 43 ++++++++++++++++++++++
3 files changed, 49 insertions(+), 1 deletion(-)
diff --git a/be/src/vec/exprs/vin_predicate.cpp
b/be/src/vec/exprs/vin_predicate.cpp
index 3f272abeac8..68481ae9295 100644
--- a/be/src/vec/exprs/vin_predicate.cpp
+++ b/be/src/vec/exprs/vin_predicate.cpp
@@ -130,7 +130,8 @@ Status VInPredicate::execute_column(VExprContext* context,
const Block* block, s
// Here, _children[0] is colA
const size_t args_size = _is_args_all_constant ? 1 : _children.size();
- ColumnNumbers arguments(args_size);
+ ColumnNumbers arguments;
+ arguments.reserve(args_size);
Block temp_block;
for (int i = 0; i < args_size; ++i) {
ColumnPtr column;
diff --git a/regression-test/data/query_p0/in_predicate/inPredicate.out
b/regression-test/data/query_p0/in_predicate/inPredicate.out
new file mode 100644
index 00000000000..6bd50c0a9fe
--- /dev/null
+++ b/regression-test/data/query_p0/in_predicate/inPredicate.out
@@ -0,0 +1,4 @@
+-- This file is automatically generated. You should know what you did if you
want to edit this
+-- !in_predicate_with_column_and_const --
+7 false false
+
diff --git a/regression-test/suites/query_p0/in_predicate/inPredicate.groovy
b/regression-test/suites/query_p0/in_predicate/inPredicate.groovy
new file mode 100644
index 00000000000..1a503c06482
--- /dev/null
+++ b/regression-test/suites/query_p0/in_predicate/inPredicate.groovy
@@ -0,0 +1,43 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// The cases is copied from https://github.com/trinodb/trino/tree/master
+//
/testing/trino-product-tests/src/main/resources/sql-tests/testcases/aggregate
+// and modified by Doris.
+suite("inPredicate") {
+ sql """
+ set debug_skip_fold_constant=true;
+
+ create table t
+ (
+ id int,
+ name string
+ )
+ duplicate key (id)
+ distributed by hash(id) buckets 3
+ properties("replication_num" = "1");
+
+ insert into t values (7, 'bbb');
+ """
+
+ qt_in_predicate_with_column_and_const """
+ select id as x1,
+ id in (6, 2 + 0.3) as x2,
+ id in (6, 2 + 0.3) as x3
+ from t;
+ """
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]