From 2985af6665bc303b0ec056789daa66abf80dcfb9 Mon Sep 17 00:00:00 2001 From: linzhenqi Date: Fri, 26 Jun 2026 23:14:34 +0800 Subject: [PATCH] [Fix](fold_const) MAKE_SET constant folding should clear --- .../expressions/functions/executable/StringArithmetic.java | 2 +- .../string_functions/test_string_function.groovy | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/executable/StringArithmetic.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/executable/StringArithmetic.java index 570d0bb4b98c95..f62e7930b29eef 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/executable/StringArithmetic.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/executable/StringArithmetic.java @@ -1202,7 +1202,7 @@ public static Expression make_set(BigIntLiteral bitLiteral, StringLikeLiteral... while (pos != 64 && pos < args.length && bit != 0) { sb.append(args[pos].getValue()); sb.append(','); - bit &= ~(1 << pos); + bit &= ~(1L << pos); pos = Long.numberOfTrailingZeros(bit); } if (sb.length() != 0) { diff --git a/regression-test/suites/query_p0/sql_functions/string_functions/test_string_function.groovy b/regression-test/suites/query_p0/sql_functions/string_functions/test_string_function.groovy index 5819ea3c8dbcdf..9db9777b1c895d 100644 --- a/regression-test/suites/query_p0/sql_functions/string_functions/test_string_function.groovy +++ b/regression-test/suites/query_p0/sql_functions/string_functions/test_string_function.groovy @@ -619,6 +619,11 @@ suite("test_string_function", "arrow_flight_sql") { testFoldConst("SELECT MAKE_SET(4611686018427387903, 'a', 'b', 'c');") testFoldConst("SELECT MAKE_SET(BIT_SHIFT_LEFT(1, 50) - 3, 'first', 'second', 'third');") testFoldConst("SELECT MAKE_SET(3, '', 'a');") + testFoldConst("SELECT MAKE_SET(4294967296, 'a00', 'a01', 'a02', 'a03', 'a04', 'a05', 'a06', 'a07', " + + "'a08', 'a09', 'a10', 'a11', 'a12', 'a13', 'a14', 'a15', " + + "'a16', 'a17', 'a18', 'a19', 'a20', 'a21', 'a22', 'a23', " + + "'a24', 'a25', 'a26', 'a27', 'a28', 'a29', 'a30', 'a31', " + + "'a32', 'a33');") test { sql"""SELECT MAKE_SET(184467440737095516156, 'a', 'b', 'c');"""