This is an automated email from the ASF dual-hosted git repository.

zclllyybb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 04bf5f6217b [Imporve](p0) Add doc example p0 (#64282)
04bf5f6217b is described below

commit 04bf5f6217bf5c090e557c1d264f8adb1aa77dcb
Author: linrrarity <[email protected]>
AuthorDate: Fri Jun 12 12:02:01 2026 +0800

    [Imporve](p0) Add doc example p0 (#64282)
    
    ### Release note
    
    Add some p0 from https://github.com/apache/doris-website/pull/3913
---
 .../doc_ai_distance_functions_test.out             |   7 +
 .../sql-functions/doc_array_functions_test.out     | 145 +++++++
 .../sql-functions/doc_bitmap_functions_test.out    |  13 +
 .../sql-functions/doc_json_functions_test.out      |  64 +++
 .../sql-functions/doc_numeric_functions_test.out   |  10 +
 .../sql-functions/doc_string_functions_test.out    | 187 +++++++++
 .../doc_ai_distance_functions_test.groovy          |  32 ++
 .../sql-functions/doc_array_functions_test.groovy  | 400 ++++++++++++++++++
 .../sql-functions/doc_bitmap_functions_test.groovy |  46 +++
 .../sql-functions/doc_json_functions_test.groovy   | 165 ++++++++
 .../doc_numeric_functions_test.groovy              |  39 ++
 .../sql-functions/doc_string_functions_test.groovy | 457 +++++++++++++++++++++
 12 files changed, 1565 insertions(+)

diff --git 
a/regression-test/data/doc/sql-manual/sql-functions/doc_ai_distance_functions_test.out
 
b/regression-test/data/doc/sql-manual/sql-functions/doc_ai_distance_functions_test.out
new file mode 100644
index 00000000000..be4fd18709b
--- /dev/null
+++ 
b/regression-test/data/doc/sql-manual/sql-functions/doc_ai_distance_functions_test.out
@@ -0,0 +1,7 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !cosine_distance --
+0.007722139    0.001539648
+
+-- !l2_distance --
+3.605551       1.414214
+
diff --git 
a/regression-test/data/doc/sql-manual/sql-functions/doc_array_functions_test.out
 
b/regression-test/data/doc/sql-manual/sql-functions/doc_array_functions_test.out
new file mode 100644
index 00000000000..e62f6f54637
--- /dev/null
+++ 
b/regression-test/data/doc/sql-manual/sql-functions/doc_array_functions_test.out
@@ -0,0 +1,145 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !array_concat_literals --
+[1, 2, 7, 8, 5, 6]
+
+-- !array_concat_string_columns --
+["a", "b", "c", "d"]
+
+-- !array_concat_empty --
+[]
+
+-- !array_concat_null --
+\N
+
+-- !array_concat_null_elements --
+[1, null, 3, null, 5, 6]
+
+-- !array_concat_type_compatible --
+["1", "2", "3", "a", "b"]
+
+-- !array_concat_nested_array --
+[[1, 2], [3, 4], [5, 6], [7, 8]]
+
+-- !array_concat_map --
+[{"k":1}, {"k":2}]
+
+-- !array_concat_struct --
+[{"name":"Alice", "age":20}, {"name":"Bob", "age":30}]
+
+-- !array_cum_sum_int --
+[1, 3, 6, 10, 15]
+
+-- !array_cum_sum_double --
+[1.1, 3.3, 6.6, 11, 16.5]
+
+-- !array_cum_sum_mixed --
+[null, 1, 1, 3, 3, 6]
+
+-- !array_cum_sum_empty --
+[]
+
+-- !array_cum_sum_null --
+\N
+
+-- !array_cum_sum_single --
+[42]
+
+-- !array_cum_sum_null_elements --
+[null, 1, 1, 4, 4, 9]
+
+-- !array_popback_string --
+["apple", "banana", "cherry"]
+
+-- !array_popback_null_elements --
+[1, null, 3, null]
+
+-- !array_popback_single --
+[]
+
+-- !array_popback_empty --
+[]
+
+-- !array_popback_null --
+\N
+
+-- !array_popback_ipv4 --
+["192.168.1.1", "192.168.1.2"]
+
+-- !array_popback_nested --
+[[1, 2], [3, 4]]
+
+-- !array_popback_map --
+[{"name":"Alice", "age":"20"}, {"name":"Bob", "age":"30"}]
+
+-- !array_popback_struct --
+[{"name":"Alice", "age":20}, {"name":"Bob", "age":30}]
+
+-- !array_popfront_string --
+["banana", "cherry", "date"]
+
+-- !array_popfront_null_elements --
+[null, 3, null, 5]
+
+-- !array_popfront_single --
+[]
+
+-- !array_popfront_empty --
+[]
+
+-- !array_popfront_null --
+\N
+
+-- !array_popfront_ipv4 --
+["192.168.1.2", "192.168.1.3"]
+
+-- !array_popfront_nested --
+[[3, 4], [5, 6]]
+
+-- !array_popfront_map --
+[{"name":"Bob", "age":"30"}, {"name":"Charlie", "age":"40"}]
+
+-- !array_popfront_struct --
+[{"name":"Bob", "age":30}, {"name":"Charlie", "age":40}]
+
+-- !array_exists_lambda_const --
+1      [1, 2, 3, 4, 5] [10, 20, -40, 80, -100] [0, 1, 1]
+2      [6, 7, 8]       [10, 12, 13]    [0, 1, 1]
+3      [1]     [-100]  [0, 1, 1]
+4      \N      \N      [0, 1, 1]
+
+-- !array_exists_even --
+[1, 2, 3, 4, 5]        [10, 20, -40, 80, -100] [0, 1, 0]
+[6, 7, 8]      [10, 12, 13]    [0, 1, 0]
+[1]    [-100]  [0, 1, 0]
+\N     \N      [0, 1, 0]
+
+-- !array_exists_abs --
+[1, 2, 3, 4, 5]        [10, 20, -40, 80, -100] [0, 1, 1]
+[6, 7, 8]      [10, 12, 13]    [0, 1, 1]
+[1]    [-100]  [0, 1, 1]
+\N     \N      [0, 1, 1]
+
+-- !array_exists_columns --
+[1, 2, 3, 4, 5]        [10, 20, -40, 80, -100] [0, 0, 1, 0, 1]
+[6, 7, 8]      [10, 12, 13]    [0, 0, 0]
+[1]    [-100]  [1]
+\N     \N      \N
+
+-- !array_exists_column_only --
+1      [1, 2, 3, 4, 5] [10, 20, -40, 80, -100] [1, 1, 1, 1, 1]
+2      [6, 7, 8]       [10, 12, 13]    [1, 1, 1]
+3      [1]     [-100]  [1]
+4      \N      \N      \N
+
+-- !array_split_basic --
+[[1, 2], [3, 4, 5]]
+
+-- !array_split_lambda --
+[[1, 2, 3, 4, 5]]
+
+-- !array_split_lambda_expression --
+[["a", "b"], ["c", "d"]]
+
+-- !array_split_date --
+[["2020-12-12", "2013-12-12"], ["2015-12-12", null]]
+
diff --git 
a/regression-test/data/doc/sql-manual/sql-functions/doc_bitmap_functions_test.out
 
b/regression-test/data/doc/sql-manual/sql-functions/doc_bitmap_functions_test.out
new file mode 100644
index 00000000000..660c1e10962
--- /dev/null
+++ 
b/regression-test/data/doc/sql-manual/sql-functions/doc_bitmap_functions_test.out
@@ -0,0 +1,13 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !bitmap_to_base64_null --
+\N
+
+-- !bitmap_to_base64_empty --
+AA==
+
+-- !bitmap_to_base64_single --
+BQEBAAAAAAAAAA==
+
+-- !bitmap_to_base64_multi --
+BQIBAAAAAAAAAH+WmAAAAAAA
+
diff --git 
a/regression-test/data/doc/sql-manual/sql-functions/doc_json_functions_test.out 
b/regression-test/data/doc/sql-manual/sql-functions/doc_json_functions_test.out
new file mode 100644
index 00000000000..cfa805f9584
--- /dev/null
+++ 
b/regression-test/data/doc/sql-manual/sql-functions/doc_json_functions_test.out
@@ -0,0 +1,64 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !json_extract_general --
+"v31"
+
+-- !json_extract_null_object --
+\N
+
+-- !json_extract_null_path --
+\N
+
+-- !json_extract_multi_level --
+1234.56
+
+-- !json_extract_array_path --
+"2025-07-16 18:35:25"
+
+-- !json_extract_non_existent --
+\N
+
+-- !json_extract_multi_paths --
+["doris",123]
+
+-- !json_extract_single_match --
+["doris"]
+
+-- !json_extract_no_match --
+\N
+
+-- !json_extract_wildcard_array --
+[1,2,3,4,5]
+
+-- !json_extract_wildcard_object --
+[[1,2,3,4,5],"abc",{"k4":"v4"},"v4"]
+
+-- !json_extract_recursive --
+[123,["ab","cd"]]
+
+-- !json_extract_3x_id --
+123
+
+-- !json_extract_3x_array --
+2
+
+-- !json_extract_3x_multi --
+["v1",6.6,[1,2],2]
+
+-- !json_extract_no_quotes --
+"doris"
+
+-- !json_extract_isnull --
+false
+
+-- !json_extract_bool --
+true
+
+-- !json_extract_int --
+123
+
+-- !json_extract_int_mismatch --
+\N
+
+-- !json_extract_string --
+doris
+
diff --git 
a/regression-test/data/doc/sql-manual/sql-functions/doc_numeric_functions_test.out
 
b/regression-test/data/doc/sql-manual/sql-functions/doc_numeric_functions_test.out
new file mode 100644
index 00000000000..ae7d9f7dd32
--- /dev/null
+++ 
b/regression-test/data/doc/sql-manual/sql-functions/doc_numeric_functions_test.out
@@ -0,0 +1,10 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !fmod_normal --
+0.4999999999999991
+
+-- !fmod_zero --
+\N
+
+-- !fmod_null --
+\N
+
diff --git 
a/regression-test/data/doc/sql-manual/sql-functions/doc_string_functions_test.out
 
b/regression-test/data/doc/sql-manual/sql-functions/doc_string_functions_test.out
new file mode 100644
index 00000000000..8b58e6fc405
--- /dev/null
+++ 
b/regression-test/data/doc/sql-manual/sql-functions/doc_string_functions_test.out
@@ -0,0 +1,187 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !auto_partition_name_range_day --
+p20221212000000
+
+-- !auto_partition_name_range_month --
+p20221201000000
+
+-- !auto_partition_name_list_single --
+phelloworld10
+
+-- !auto_partition_name_list_multi --
+phello5world5
+
+-- !auto_partition_name_utf8 --
+p1e6d1e5bec31e0d1e0dumai6
+
+-- !to_base64_basic --
+MQ==   QQ==
+
+-- !to_base64_multi --
+MjM0   SGVsbG8=
+
+-- !to_base64_null_empty --
+\N     
+
+-- !to_base64_long --
+SGVsbG8gV29ybGQ=       VGhlIHF1aWNrIGJyb3duIGZveA==
+
+-- !to_base64_special --
+MTIzNDU2       IUAjJCVeJiooKQ==
+
+-- !to_base64_utf8 --
+4bmt4bmbw6w=   4biN4biNdW1haSBoZWxsbw==
+
+-- !to_base64_email --
+dXNlckBleGFtcGxlLmNvbQ==       YWRtaW4udGVzdEBjb21wYW55Lm9yZw==
+
+-- !to_base64_json --
+eyJuYW1lIjoiSm9obiIsImFnZSI6MzB9       WzEsMiwzLDQsNV0=
+
+-- !to_base64_padding --
+YQ==   YWI=    YWJj
+
+-- !from_base64_basic --
+1      A
+
+-- !from_base64_multi --
+234    Hello
+
+-- !from_base64_null --
+\N
+
+-- !from_base64_empty --
+
+
+-- !from_base64_invalid --
+\N     \N
+
+-- !from_base64_long --
+Hello World    The quick brown fox
+
+-- !from_base64_utf8 --
+ṭṛì    ṍṍumai hello
+
+-- !from_base64_email --
[email protected]       [email protected]
+
+-- !from_base64_json --
+{"name":"John","age":30}       [1,2,3,4,5]
+
+-- !from_base64_round_trip --
+Hello  测试
+
+-- !instr_basic --
+2      0
+
+-- !instr_substring --
+7      0
+
+-- !instr_null --
+\N     \N
+
+-- !instr_empty --
+1      0
+
+-- !instr_repeated --
+1      2
+
+-- !instr_special --
+5      8
+
+-- !instr_utf8 --
+5      12
+
+-- !instr_digits --
+4      4
+
+-- !instr_long --
+5      0
+
+-- !instr_url --
+1      6
+
+-- !length_ascii --
+3      3
+
+-- !length_chinese --
+6      2
+
+-- !length_null --
+\N
+
+-- !length_empty --
+0
+
+-- !length_mixed --
+11     7
+
+-- !length_special --
+3      2
+
+-- !length_utf8 --
+8      3
+
+-- !length_emoji --
+8      2
+
+-- !length_digits --
+5      5
+
+-- !locate_basic --
+4      0       7
+
+-- !locate_first_last --
+1      6
+
+-- !locate_not_found --
+0      0
+
+-- !locate_null --
+\N     \N      \N
+
+-- !locate_empty --
+1      0       1
+
+-- !locate_start_position --
+2      2       0
+
+-- !locate_boundaries --
+0      0       0
+
+-- !locate_utf8 --
+2      5
+
+-- !locate_case_sensitive --
+0      0       0
+
+-- !locate_empty_with_position --
+3      0       1
+
+-- !lpad_basic --
+xyxhi  ***hello
+
+-- !lpad_truncate --
+h      hello
+
+-- !lpad_null --
+\N     \N      \N
+
+-- !lpad_empty_zero --
+               *****
+
+-- !lpad_empty_pad --
+       hi
+
+-- !lpad_long_pad --
+abcabca123     HELLOHX
+
+-- !lpad_utf8 --
+ṭṛìṭṛhello     ḍḍu
+
+-- !lpad_numeric --
+000042 00001234
+
+-- !lpad_negative --
+\N     \N
+
diff --git 
a/regression-test/suites/doc/sql-manual/sql-functions/doc_ai_distance_functions_test.groovy
 
b/regression-test/suites/doc/sql-manual/sql-functions/doc_ai_distance_functions_test.groovy
new file mode 100644
index 00000000000..47f48437927
--- /dev/null
+++ 
b/regression-test/suites/doc/sql-manual/sql-functions/doc_ai_distance_functions_test.groovy
@@ -0,0 +1,32 @@
+// 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.
+
+suite("doc_ai_distance_functions_test") {
+    qt_cosine_distance '''
+        SELECT COSINE_DISTANCE([1, 2], [2, 3]), COSINE_DISTANCE([3, 6], [4, 
7]);
+    '''
+    testFoldConst('''
+        SELECT COSINE_DISTANCE([1, 2], [2, 3]), COSINE_DISTANCE([3, 6], [4, 
7]);
+    ''')
+
+    qt_l2_distance '''
+        SELECT L2_DISTANCE([4, 5], [6, 8]), L2_DISTANCE([3, 6], [4, 5]);
+    '''
+    testFoldConst('''
+        SELECT L2_DISTANCE([4, 5], [6, 8]), L2_DISTANCE([3, 6], [4, 5]);
+    ''')
+}
diff --git 
a/regression-test/suites/doc/sql-manual/sql-functions/doc_array_functions_test.groovy
 
b/regression-test/suites/doc/sql-manual/sql-functions/doc_array_functions_test.groovy
new file mode 100644
index 00000000000..8641f929668
--- /dev/null
+++ 
b/regression-test/suites/doc/sql-manual/sql-functions/doc_array_functions_test.groovy
@@ -0,0 +1,400 @@
+// 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.
+
+suite("doc_array_functions_test") {
+    sql ''' DROP TABLE IF EXISTS doc_array_concat_test; '''
+    sql '''
+        CREATE TABLE doc_array_concat_test (
+            id INT,
+            int_array1 ARRAY<INT>,
+            int_array2 ARRAY<INT>,
+            string_array1 ARRAY<STRING>,
+            string_array2 ARRAY<STRING>
+        )
+        DUPLICATE KEY(id)
+        DISTRIBUTED BY HASH(id) BUCKETS 1
+        PROPERTIES (
+            "replication_num" = "1"
+        );
+    '''
+    sql '''
+        INSERT INTO doc_array_concat_test VALUES
+        (1, [1, 2, 3], [4, 5, 6], ['a', 'b'], ['c', 'd']),
+        (2, [10, 20], [30, 40], [], ['x', 'y']),
+        (3, NULL, [100, 200], NULL, ['z']),
+        (4, [], [], [], []),
+        (5, [1, null, 3], [null, 5, 6], ['a', null, 'c'], ['d', 'e']);
+    '''
+
+    qt_array_concat_literals '''
+        SELECT array_concat([1, 2], [7, 8], [5, 6]);
+    '''
+    testFoldConst('''
+        SELECT array_concat([1, 2], [7, 8], [5, 6]);
+    ''')
+
+    qt_array_concat_string_columns '''
+        SELECT array_concat(string_array1, string_array2) FROM 
doc_array_concat_test WHERE id = 1;
+    '''
+
+    qt_array_concat_empty '''
+        SELECT array_concat([], []);
+    '''
+    testFoldConst('''
+        SELECT array_concat([], []);
+    ''')
+
+    qt_array_concat_null '''
+        SELECT array_concat(int_array1, int_array2) FROM doc_array_concat_test 
WHERE id = 3;
+    '''
+
+    qt_array_concat_null_elements '''
+        SELECT array_concat(int_array1, int_array2) FROM doc_array_concat_test 
WHERE id = 5;
+    '''
+
+    qt_array_concat_type_compatible '''
+        SELECT array_concat(int_array1, string_array1) FROM 
doc_array_concat_test WHERE id = 1;
+    '''
+
+    qt_array_concat_nested_array '''
+        SELECT array_concat([[1,2],[3,4]], [[5,6],[7,8]]);
+    '''
+    testFoldConst('''
+        SELECT array_concat([[1,2],[3,4]], [[5,6],[7,8]]);
+    ''')
+
+    test {
+        sql ''' SELECT array_concat([[1,2]], [{'k':1}]); '''
+        exception "can not cast"
+    }
+
+    qt_array_concat_map '''
+        SELECT array_concat([{'k':1}], [{'k':2}]);
+    '''
+    testFoldConst('''
+        SELECT array_concat([{'k':1}], [{'k':2}]);
+    ''')
+
+    qt_array_concat_struct '''
+        SELECT array_concat(array(named_struct('name','Alice','age',20)), 
array(named_struct('name','Bob','age',30)));
+    '''
+    testFoldConst('''
+        SELECT array_concat(array(named_struct('name','Alice','age',20)), 
array(named_struct('name','Bob','age',30)));
+    ''')
+
+    test {
+        sql ''' SELECT 
array_concat(array(named_struct('name','Alice','age',20)), 
array(named_struct('id',1,'score',95.5,'age',10))); '''
+        exception "can not cast"
+    }
+
+    test {
+        sql ''' SELECT array_concat(); '''
+        exception "array_concat"
+    }
+
+    test {
+        sql ''' SELECT array_concat('not_an_array'); '''
+        exception "array_concat"
+    }
+
+    sql ''' DROP TABLE IF EXISTS doc_array_cum_sum_test; '''
+    sql '''
+        CREATE TABLE doc_array_cum_sum_test (
+            id INT,
+            int_array ARRAY<INT>,
+            double_array ARRAY<DOUBLE>
+        )
+        DUPLICATE KEY(id)
+        DISTRIBUTED BY HASH(id) BUCKETS 1
+        PROPERTIES (
+            "replication_num" = "1"
+        );
+    '''
+    sql '''
+        INSERT INTO doc_array_cum_sum_test VALUES
+        (1, [1, 2, 3, 4, 5], [1.1, 2.2, 3.3, 4.4, 5.5]),
+        (2, [10, 20, 30], [10.5, 20.5, 30.5]),
+        (3, [], []),
+        (4, NULL, NULL);
+    '''
+
+    qt_array_cum_sum_int '''
+        SELECT array_cum_sum(int_array) FROM doc_array_cum_sum_test WHERE id = 
1;
+    '''
+
+    qt_array_cum_sum_double '''
+        SELECT array_cum_sum(double_array) FROM doc_array_cum_sum_test WHERE 
id = 1;
+    '''
+
+    qt_array_cum_sum_mixed '''
+        SELECT array_cum_sum(['a', 1, 'b', 2, 'c', 3]);
+    '''
+    testFoldConst('''
+        SELECT array_cum_sum(['a', 1, 'b', 2, 'c', 3]);
+    ''')
+
+    qt_array_cum_sum_empty '''
+        SELECT array_cum_sum(int_array) FROM doc_array_cum_sum_test WHERE id = 
3;
+    '''
+
+    qt_array_cum_sum_null '''
+        SELECT array_cum_sum(int_array) FROM doc_array_cum_sum_test WHERE id = 
4;
+    '''
+
+    qt_array_cum_sum_single '''
+        SELECT array_cum_sum([42]);
+    '''
+    testFoldConst('''
+        SELECT array_cum_sum([42]);
+    ''')
+
+    qt_array_cum_sum_null_elements '''
+        SELECT array_cum_sum([null, 1, null, 3, null, 5]);
+    '''
+    testFoldConst('''
+        SELECT array_cum_sum([null, 1, null, 3, null, 5]);
+    ''')
+
+    test {
+        sql ''' SELECT array_cum_sum([[1,2,3]]); '''
+        exception "array_cum_sum"
+    }
+
+    test {
+        sql ''' SELECT array_cum_sum([{'k':1},{'k':2}]); '''
+        exception "array_cum_sum"
+    }
+
+    test {
+        sql ''' SELECT 
array_cum_sum(array(named_struct('name','Alice','age',20),named_struct('name','Bob','age',30)));
 '''
+        exception "array_cum_sum"
+    }
+
+    test {
+        sql ''' SELECT array_cum_sum([1,2,3],[4,5,6]); '''
+        exception "array_cum_sum"
+    }
+
+    test {
+        sql ''' SELECT array_cum_sum('not_an_array'); '''
+        exception "array_cum_sum"
+    }
+
+    qt_array_popback_string '''
+        SELECT array_popback(['apple', 'banana', 'cherry', 'date']);
+    '''
+    testFoldConst('''
+        SELECT array_popback(['apple', 'banana', 'cherry', 'date']);
+    ''')
+
+    qt_array_popback_null_elements '''
+        SELECT array_popback([1, null, 3, null, 5]);
+    '''
+    testFoldConst('''
+        SELECT array_popback([1, null, 3, null, 5]);
+    ''')
+
+    qt_array_popback_single '''
+        SELECT array_popback([42]);
+    '''
+    testFoldConst('''
+        SELECT array_popback([42]);
+    ''')
+
+    qt_array_popback_empty '''
+        SELECT array_popback([]);
+    '''
+    testFoldConst('''
+        SELECT array_popback([]);
+    ''')
+
+    qt_array_popback_null '''
+        SELECT array_popback(NULL);
+    '''
+    testFoldConst('''
+        SELECT array_popback(NULL);
+    ''')
+
+    qt_array_popback_ipv4 '''
+        SELECT array_popback(CAST(['192.168.1.1', '192.168.1.2', 
'192.168.1.3'] AS ARRAY<IPV4>));
+    '''
+    testFoldConst('''
+        SELECT array_popback(CAST(['192.168.1.1', '192.168.1.2', 
'192.168.1.3'] AS ARRAY<IPV4>));
+    ''')
+
+    qt_array_popback_nested '''
+        SELECT array_popback([[1, 2], [3, 4], [5, 6]]);
+    '''
+    testFoldConst('''
+        SELECT array_popback([[1, 2], [3, 4], [5, 6]]);
+    ''')
+
+    qt_array_popback_map '''
+        SELECT array_popback([{'name':'Alice','age':20}, 
{'name':'Bob','age':30}, {'name':'Charlie','age':40}]);
+    '''
+    testFoldConst('''
+        SELECT array_popback([{'name':'Alice','age':20}, 
{'name':'Bob','age':30}, {'name':'Charlie','age':40}]);
+    ''')
+
+    qt_array_popback_struct '''
+        SELECT array_popback(array(named_struct('name','Alice','age',20), 
named_struct('name','Bob','age',30), named_struct('name','Charlie','age',40)));
+    '''
+    testFoldConst('''
+        SELECT array_popback(array(named_struct('name','Alice','age',20), 
named_struct('name','Bob','age',30), named_struct('name','Charlie','age',40)));
+    ''')
+
+    qt_array_popfront_string '''
+        SELECT array_popfront(['apple', 'banana', 'cherry', 'date']);
+    '''
+    testFoldConst('''
+        SELECT array_popfront(['apple', 'banana', 'cherry', 'date']);
+    ''')
+
+    qt_array_popfront_null_elements '''
+        SELECT array_popfront([1, null, 3, null, 5]);
+    '''
+    testFoldConst('''
+        SELECT array_popfront([1, null, 3, null, 5]);
+    ''')
+
+    qt_array_popfront_single '''
+        SELECT array_popfront([42]);
+    '''
+    testFoldConst('''
+        SELECT array_popfront([42]);
+    ''')
+
+    qt_array_popfront_empty '''
+        SELECT array_popfront([]);
+    '''
+    testFoldConst('''
+        SELECT array_popfront([]);
+    ''')
+
+    qt_array_popfront_null '''
+        SELECT array_popfront(NULL);
+    '''
+    testFoldConst('''
+        SELECT array_popfront(NULL);
+    ''')
+
+    qt_array_popfront_ipv4 '''
+        SELECT array_popfront(CAST(['192.168.1.1', '192.168.1.2', 
'192.168.1.3'] AS ARRAY<IPV4>));
+    '''
+    testFoldConst('''
+        SELECT array_popfront(CAST(['192.168.1.1', '192.168.1.2', 
'192.168.1.3'] AS ARRAY<IPV4>));
+    ''')
+
+    qt_array_popfront_nested '''
+        SELECT array_popfront([[1, 2], [3, 4], [5, 6]]);
+    '''
+    testFoldConst('''
+        SELECT array_popfront([[1, 2], [3, 4], [5, 6]]);
+    ''')
+
+    qt_array_popfront_map '''
+        SELECT array_popfront([{'name':'Alice','age':20}, 
{'name':'Bob','age':30}, {'name':'Charlie','age':40}]);
+    '''
+    testFoldConst('''
+        SELECT array_popfront([{'name':'Alice','age':20}, 
{'name':'Bob','age':30}, {'name':'Charlie','age':40}]);
+    ''')
+
+    qt_array_popfront_struct '''
+        SELECT array_popfront(array(named_struct('name','Alice','age',20), 
named_struct('name','Bob','age',30), named_struct('name','Charlie','age',40)));
+    '''
+    testFoldConst('''
+        SELECT array_popfront(array(named_struct('name','Alice','age',20), 
named_struct('name','Bob','age',30), named_struct('name','Charlie','age',40)));
+    ''')
+
+    sql ''' DROP TABLE IF EXISTS doc_array_test2; '''
+    sql '''
+        CREATE TABLE doc_array_test2 (
+            id INT,
+            c_array1 ARRAY<INT>,
+            c_array2 ARRAY<INT>
+        )
+        DUPLICATE KEY(id)
+        DISTRIBUTED BY HASH(id) BUCKETS 1
+        PROPERTIES(
+          "replication_num" = "1"
+        );
+    '''
+    sql '''
+        INSERT INTO doc_array_test2 VALUES
+        (1, [1, 2, 3, 4, 5], [10, 20, -40, 80, -100]),
+        (2, [6, 7, 8], [10, 12, 13]),
+        (3, [1], [-100]),
+        (4, NULL, NULL);
+    '''
+
+    qt_array_exists_lambda_const '''
+        SELECT *, array_exists(x -> x > 1, [1,2,3]) FROM doc_array_test2 ORDER 
BY id;
+    '''
+    testFoldConst('''
+        SELECT *, array_exists(x -> x > 1, [1,2,3]) FROM doc_array_test2 ORDER 
BY id;
+    ''')
+
+    qt_array_exists_even '''
+        SELECT c_array1, c_array2, array_exists(x -> x % 2 = 0, [1,2,3]) FROM 
doc_array_test2 ORDER BY id;
+    '''
+    testFoldConst('''
+        SELECT c_array1, c_array2, array_exists(x -> x % 2 = 0, [1,2,3]) FROM 
doc_array_test2 ORDER BY id;
+    ''')
+
+    qt_array_exists_abs '''
+        SELECT c_array1, c_array2, array_exists(x -> abs(x) - 1, [1,2,3]) FROM 
doc_array_test2 ORDER BY id;
+    '''
+    testFoldConst('''
+        SELECT c_array1, c_array2, array_exists(x -> abs(x) - 1, [1,2,3]) FROM 
doc_array_test2 ORDER BY id;
+    ''')
+
+    qt_array_exists_columns '''
+        SELECT c_array1, c_array2, array_exists((x,y) -> x > y, c_array1, 
c_array2) FROM doc_array_test2 ORDER BY id;
+    '''
+
+    qt_array_exists_column_only '''
+        SELECT *, array_exists(c_array1) FROM doc_array_test2 ORDER BY id;
+    '''
+
+    qt_array_split_basic '''
+        SELECT array_split([1,2,3,4,5], [1,0,1,0,0]);
+    '''
+    testFoldConst('''
+        SELECT array_split([1,2,3,4,5], [1,0,1,0,0]);
+    ''')
+
+    qt_array_split_lambda '''
+        SELECT array_split((x,y) -> y, [1,2,3,4,5], [1,0,0,0,0]);
+    '''
+    testFoldConst('''
+        SELECT array_split((x,y) -> y, [1,2,3,4,5], [1,0,0,0,0]);
+    ''')
+
+    qt_array_split_lambda_expression '''
+        SELECT array_split((x,y) -> (y+1), ['a', 'b', 'c', 'd'], [-1, -1, 0, 
-1]);
+    '''
+    testFoldConst('''
+        SELECT array_split((x,y) -> (y+1), ['a', 'b', 'c', 'd'], [-1, -1, 0, 
-1]);
+    ''')
+
+    qt_array_split_date '''
+        SELECT array_split(x -> (year(x) > 2013), ["2020-12-12", "2013-12-12", 
"2015-12-12", NULL]);
+    '''
+    testFoldConst('''
+        SELECT array_split(x -> (year(x) > 2013), ["2020-12-12", "2013-12-12", 
"2015-12-12", NULL]);
+    ''')
+}
diff --git 
a/regression-test/suites/doc/sql-manual/sql-functions/doc_bitmap_functions_test.groovy
 
b/regression-test/suites/doc/sql-manual/sql-functions/doc_bitmap_functions_test.groovy
new file mode 100644
index 00000000000..0fe8c15161d
--- /dev/null
+++ 
b/regression-test/suites/doc/sql-manual/sql-functions/doc_bitmap_functions_test.groovy
@@ -0,0 +1,46 @@
+// 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.
+
+suite("doc_bitmap_functions_test") {
+    qt_bitmap_to_base64_null '''
+        SELECT bitmap_to_base64(NULL);
+    '''
+    testFoldConst('''
+        SELECT bitmap_to_base64(NULL);
+    ''')
+
+    qt_bitmap_to_base64_empty '''
+        SELECT bitmap_to_base64(bitmap_empty());
+    '''
+    testFoldConst('''
+        SELECT bitmap_to_base64(bitmap_empty());
+    ''')
+
+    qt_bitmap_to_base64_single '''
+        SELECT bitmap_to_base64(to_bitmap(1));
+    '''
+    testFoldConst('''
+        SELECT bitmap_to_base64(to_bitmap(1));
+    ''')
+
+    qt_bitmap_to_base64_multi '''
+        SELECT bitmap_to_base64(bitmap_from_string("1,9999999"));
+    '''
+    testFoldConst('''
+        SELECT bitmap_to_base64(bitmap_from_string("1,9999999"));
+    ''')
+}
diff --git 
a/regression-test/suites/doc/sql-manual/sql-functions/doc_json_functions_test.groovy
 
b/regression-test/suites/doc/sql-manual/sql-functions/doc_json_functions_test.groovy
new file mode 100644
index 00000000000..f21f18801b4
--- /dev/null
+++ 
b/regression-test/suites/doc/sql-manual/sql-functions/doc_json_functions_test.groovy
@@ -0,0 +1,165 @@
+// 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.
+
+suite("doc_json_functions_test") {
+    qt_json_extract_general '''
+        SELECT JSON_EXTRACT('{"k1":"v31","k2":300}', '$.k1');
+    '''
+    testFoldConst('''
+        SELECT JSON_EXTRACT('{"k1":"v31","k2":300}', '$.k1');
+    ''')
+
+    qt_json_extract_null_object '''
+        SELECT JSON_EXTRACT(NULL, '$.k1');
+    '''
+    testFoldConst('''
+        SELECT JSON_EXTRACT(NULL, '$.k1');
+    ''')
+
+    qt_json_extract_null_path '''
+        SELECT JSON_EXTRACT('{"k1":"v31","k2":300}', NULL);
+    '''
+    testFoldConst('''
+        SELECT JSON_EXTRACT('{"k1":"v31","k2":300}', NULL);
+    ''')
+
+    qt_json_extract_multi_level '''
+        SELECT JSON_EXTRACT('{"k1":"v31","k2":{"sub_key": 1234.56}}', 
'$.k2.sub_key');
+    '''
+    testFoldConst('''
+        SELECT JSON_EXTRACT('{"k1":"v31","k2":{"sub_key": 1234.56}}', 
'$.k2.sub_key');
+    ''')
+
+    qt_json_extract_array_path '''
+        SELECT JSON_EXTRACT(json_array("abc", 123, "2025-07-16 18:35:25"), 
'$[2]');
+    '''
+    testFoldConst('''
+        SELECT JSON_EXTRACT(json_array("abc", 123, "2025-07-16 18:35:25"), 
'$[2]');
+    ''')
+
+    qt_json_extract_non_existent '''
+        SELECT JSON_EXTRACT('{"k1":"v31","k2":300}', '$.k3');
+    '''
+    testFoldConst('''
+        SELECT JSON_EXTRACT('{"k1":"v31","k2":300}', '$.k3');
+    ''')
+
+    qt_json_extract_multi_paths '''
+        SELECT JSON_EXTRACT('{"id": 123, "name": "doris"}', '$.name', '$.id', 
'$.not_exists');
+    '''
+    testFoldConst('''
+        SELECT JSON_EXTRACT('{"id": 123, "name": "doris"}', '$.name', '$.id', 
'$.not_exists');
+    ''')
+
+    qt_json_extract_single_match '''
+        SELECT json_extract('{"id": 123, "name": "doris"}', '$.aaa', '$.name');
+    '''
+    testFoldConst('''
+        SELECT json_extract('{"id": 123, "name": "doris"}', '$.aaa', '$.name');
+    ''')
+
+    qt_json_extract_no_match '''
+        SELECT JSON_EXTRACT('{"id": 123, "name": "doris"}', '$.k1', '$.k2', 
'$.not_exists');
+    '''
+    testFoldConst('''
+        SELECT JSON_EXTRACT('{"id": 123, "name": "doris"}', '$.k1', '$.k2', 
'$.not_exists');
+    ''')
+
+    qt_json_extract_wildcard_array '''
+        SELECT json_extract('{"k": [1,2,3,4,5]}', '$.k[*]');
+    '''
+    testFoldConst('''
+        SELECT json_extract('{"k": [1,2,3,4,5]}', '$.k[*]');
+    ''')
+
+    qt_json_extract_wildcard_object '''
+        SELECT json_extract('{"k": [1,2,3,4,5], "k2": "abc", "k3": {"k4": 
"v4"}}', '$.*', '$.k3.k4');
+    '''
+    testFoldConst('''
+        SELECT json_extract('{"k": [1,2,3,4,5], "k2": "abc", "k3": {"k4": 
"v4"}}', '$.*', '$.k3.k4');
+    ''')
+
+    qt_json_extract_recursive '''
+        SELECT json_extract('{"k": 123, "b": {"k": ["ab", "cd"]}}', '$**.k');
+    '''
+    testFoldConst('''
+        SELECT json_extract('{"k": 123, "b": {"k": ["ab", "cd"]}}', '$**.k');
+    ''')
+
+    qt_json_extract_3x_id '''
+        SELECT json_extract('{"id": 123, "name": "doris"}', '$.id');
+    '''
+    testFoldConst('''
+        SELECT json_extract('{"id": 123, "name": "doris"}', '$.id');
+    ''')
+
+    qt_json_extract_3x_array '''
+        SELECT json_extract('[1, 2, 3]', '$.[1]');
+    '''
+    testFoldConst('''
+        SELECT json_extract('[1, 2, 3]', '$.[1]');
+    ''')
+
+    qt_json_extract_3x_multi '''
+        SELECT json_extract('{"k1": "v1", "k2": { "k21": 6.6, "k22": [1, 2] } 
}', '$.k1', '$.k2.k21', '$.k2.k22', '$.k2.k22[1]');
+    '''
+    testFoldConst('''
+        SELECT json_extract('{"k1": "v1", "k2": { "k21": 6.6, "k22": [1, 2] } 
}', '$.k1', '$.k2.k21', '$.k2.k22', '$.k2.k22[1]');
+    ''')
+
+    qt_json_extract_no_quotes '''
+        SELECT json_extract_no_quotes('{"id": 123, "name": "doris"}', 
'$.name');
+    '''
+    testFoldConst('''
+        SELECT json_extract_no_quotes('{"id": 123, "name": "doris"}', 
'$.name');
+    ''')
+
+    qt_json_extract_isnull '''
+        SELECT JSON_EXTRACT_ISNULL('{"id": 123, "name": "doris"}', '$.id');
+    '''
+    testFoldConst('''
+        SELECT JSON_EXTRACT_ISNULL('{"id": 123, "name": "doris"}', '$.id');
+    ''')
+
+    qt_json_extract_bool '''
+        SELECT JSON_EXTRACT_BOOL('{"id": 123, "name": "NULL"}', '$.id');
+    '''
+    testFoldConst('''
+        SELECT JSON_EXTRACT_BOOL('{"id": 123, "name": "NULL"}', '$.id');
+    ''')
+
+    qt_json_extract_int '''
+        SELECT JSON_EXTRACT_INT('{"id": 123, "name": "NULL"}', '$.id');
+    '''
+    testFoldConst('''
+        SELECT JSON_EXTRACT_INT('{"id": 123, "name": "NULL"}', '$.id');
+    ''')
+
+    qt_json_extract_int_mismatch '''
+        SELECT JSON_EXTRACT_INT('{"id": 123, "name": "doris"}', '$.name');
+    '''
+    testFoldConst('''
+        SELECT JSON_EXTRACT_INT('{"id": 123, "name": "doris"}', '$.name');
+    ''')
+
+    qt_json_extract_string '''
+        SELECT JSON_EXTRACT_STRING('{"id": 123, "name": "doris"}', '$.name');
+    '''
+    testFoldConst('''
+        SELECT JSON_EXTRACT_STRING('{"id": 123, "name": "doris"}', '$.name');
+    ''')
+}
diff --git 
a/regression-test/suites/doc/sql-manual/sql-functions/doc_numeric_functions_test.groovy
 
b/regression-test/suites/doc/sql-manual/sql-functions/doc_numeric_functions_test.groovy
new file mode 100644
index 00000000000..e09aec04270
--- /dev/null
+++ 
b/regression-test/suites/doc/sql-manual/sql-functions/doc_numeric_functions_test.groovy
@@ -0,0 +1,39 @@
+// 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.
+
+suite("doc_numeric_functions_test") {
+    qt_fmod_normal '''
+        SELECT fmod(10.1, 3.2);
+    '''
+    testFoldConst('''
+        SELECT fmod(10.1, 3.2);
+    ''')
+
+    qt_fmod_zero '''
+        SELECT fmod(10.1, 0);
+    '''
+    testFoldConst('''
+        SELECT fmod(10.1, 0);
+    ''')
+
+    qt_fmod_null '''
+        SELECT fmod(10.1, NULL);
+    '''
+    testFoldConst('''
+        SELECT fmod(10.1, NULL);
+    ''')
+}
diff --git 
a/regression-test/suites/doc/sql-manual/sql-functions/doc_string_functions_test.groovy
 
b/regression-test/suites/doc/sql-manual/sql-functions/doc_string_functions_test.groovy
new file mode 100644
index 00000000000..fc6cca41e11
--- /dev/null
+++ 
b/regression-test/suites/doc/sql-manual/sql-functions/doc_string_functions_test.groovy
@@ -0,0 +1,457 @@
+// 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.
+
+suite("doc_string_functions_test") {
+    qt_auto_partition_name_range_day '''
+        SELECT auto_partition_name('range', 'day', '2022-12-12 19:20:30');
+    '''
+    testFoldConst('''
+        SELECT auto_partition_name('range', 'day', '2022-12-12 19:20:30');
+    ''')
+
+    qt_auto_partition_name_range_month '''
+        SELECT auto_partition_name('range', 'month', '2022-12-12 19:20:30');
+    '''
+    testFoldConst('''
+        SELECT auto_partition_name('range', 'month', '2022-12-12 19:20:30');
+    ''')
+
+    qt_auto_partition_name_list_single '''
+        SELECT auto_partition_name('list', 'helloworld');
+    '''
+    testFoldConst('''
+        SELECT auto_partition_name('list', 'helloworld');
+    ''')
+
+    qt_auto_partition_name_list_multi '''
+        SELECT auto_partition_name('list', 'hello', 'world');
+    '''
+    testFoldConst('''
+        SELECT auto_partition_name('list', 'hello', 'world');
+    ''')
+
+    qt_auto_partition_name_utf8 '''
+        SELECT auto_partition_name('list', 'ṭṛì', 'ḍḍumai');
+    '''
+    testFoldConst('''
+        SELECT auto_partition_name('list', 'ṭṛì', 'ḍḍumai');
+    ''')
+
+    test {
+        sql ''' SELECT auto_partition_name('range', 'years', '2022-12-12'); '''
+        exception "range auto_partition_name must accept"
+    }
+
+    qt_to_base64_basic '''
+        SELECT TO_BASE64('1'), TO_BASE64('A');
+    '''
+    testFoldConst('''
+        SELECT TO_BASE64('1'), TO_BASE64('A');
+    ''')
+
+    qt_to_base64_multi '''
+        SELECT TO_BASE64('234'), TO_BASE64('Hello');
+    '''
+    testFoldConst('''
+        SELECT TO_BASE64('234'), TO_BASE64('Hello');
+    ''')
+
+    qt_to_base64_null_empty '''
+        SELECT TO_BASE64(NULL), TO_BASE64('');
+    '''
+    testFoldConst('''
+        SELECT TO_BASE64(NULL), TO_BASE64('');
+    ''')
+
+    qt_to_base64_long '''
+        SELECT TO_BASE64('Hello World'), TO_BASE64('The quick brown fox');
+    '''
+    testFoldConst('''
+        SELECT TO_BASE64('Hello World'), TO_BASE64('The quick brown fox');
+    ''')
+
+    qt_to_base64_special '''
+        SELECT TO_BASE64('123456'), TO_BASE64('!@#$%^&*()');
+    '''
+    testFoldConst('''
+        SELECT TO_BASE64('123456'), TO_BASE64('!@#$%^&*()');
+    ''')
+
+    qt_to_base64_utf8 '''
+        SELECT TO_BASE64('ṭṛì'), TO_BASE64('ḍḍumai hello');
+    '''
+    testFoldConst('''
+        SELECT TO_BASE64('ṭṛì'), TO_BASE64('ḍḍumai hello');
+    ''')
+
+    qt_to_base64_email '''
+        SELECT TO_BASE64('[email protected]'), 
TO_BASE64('[email protected]');
+    '''
+    testFoldConst('''
+        SELECT TO_BASE64('[email protected]'), 
TO_BASE64('[email protected]');
+    ''')
+
+    qt_to_base64_json '''
+        SELECT TO_BASE64('{"name":"John","age":30}'), TO_BASE64('[1,2,3,4,5]');
+    '''
+    testFoldConst('''
+        SELECT TO_BASE64('{"name":"John","age":30}'), TO_BASE64('[1,2,3,4,5]');
+    ''')
+
+    qt_to_base64_padding '''
+        SELECT TO_BASE64('a'), TO_BASE64('ab'), TO_BASE64('abc');
+    '''
+    testFoldConst('''
+        SELECT TO_BASE64('a'), TO_BASE64('ab'), TO_BASE64('abc');
+    ''')
+
+    qt_from_base64_basic '''
+        SELECT FROM_BASE64('MQ=='), FROM_BASE64('QQ==');
+    '''
+    testFoldConst('''
+        SELECT FROM_BASE64('MQ=='), FROM_BASE64('QQ==');
+    ''')
+
+    qt_from_base64_multi '''
+        SELECT FROM_BASE64('MjM0'), FROM_BASE64('SGVsbG8=');
+    '''
+    testFoldConst('''
+        SELECT FROM_BASE64('MjM0'), FROM_BASE64('SGVsbG8=');
+    ''')
+
+    qt_from_base64_null '''
+        SELECT FROM_BASE64(NULL);
+    '''
+    testFoldConst('''
+        SELECT FROM_BASE64(NULL);
+    ''')
+
+    qt_from_base64_empty '''
+        SELECT FROM_BASE64('');
+    '''
+    testFoldConst('''
+        SELECT FROM_BASE64('');
+    ''')
+
+    qt_from_base64_invalid '''
+        SELECT FROM_BASE64('!!!'), FROM_BASE64('ABC@DEF');
+    '''
+    testFoldConst('''
+        SELECT FROM_BASE64('!!!'), FROM_BASE64('ABC@DEF');
+    ''')
+
+    qt_from_base64_long '''
+        SELECT FROM_BASE64('SGVsbG8gV29ybGQ='), 
FROM_BASE64('VGhlIHF1aWNrIGJyb3duIGZveA==');
+    '''
+    testFoldConst('''
+        SELECT FROM_BASE64('SGVsbG8gV29ybGQ='), 
FROM_BASE64('VGhlIHF1aWNrIGJyb3duIGZveA==');
+    ''')
+
+    qt_from_base64_utf8 '''
+        SELECT FROM_BASE64('4bmt4bmbw6w='), 
FROM_BASE64('4bmN4bmNdW1haSBoZWxsbw==');
+    '''
+    testFoldConst('''
+        SELECT FROM_BASE64('4bmt4bmbw6w='), 
FROM_BASE64('4bmN4bmNdW1haSBoZWxsbw==');
+    ''')
+
+    qt_from_base64_email '''
+        SELECT FROM_BASE64('dXNlckBleGFtcGxlLmNvbQ=='), 
FROM_BASE64('YWRtaW4udGVzdEBjb21wYW55Lm9yZw==');
+    '''
+    testFoldConst('''
+        SELECT FROM_BASE64('dXNlckBleGFtcGxlLmNvbQ=='), 
FROM_BASE64('YWRtaW4udGVzdEBjb21wYW55Lm9yZw==');
+    ''')
+
+    qt_from_base64_json '''
+        SELECT FROM_BASE64('eyJuYW1lIjoiSm9obiIsImFnZSI6MzB9'), 
FROM_BASE64('WzEsMiwzLDQsNV0=');
+    '''
+    testFoldConst('''
+        SELECT FROM_BASE64('eyJuYW1lIjoiSm9obiIsImFnZSI6MzB9'), 
FROM_BASE64('WzEsMiwzLDQsNV0=');
+    ''')
+
+    qt_from_base64_round_trip '''
+        SELECT FROM_BASE64(TO_BASE64('Hello')), FROM_BASE64(TO_BASE64('测试'));
+    '''
+    testFoldConst('''
+        SELECT FROM_BASE64(TO_BASE64('Hello')), FROM_BASE64(TO_BASE64('测试'));
+    ''')
+
+    qt_instr_basic '''
+        SELECT INSTR('abc', 'b'), INSTR('abc', 'd');
+    '''
+    testFoldConst('''
+        SELECT INSTR('abc', 'b'), INSTR('abc', 'd');
+    ''')
+
+    qt_instr_substring '''
+        SELECT INSTR('hello world', 'world'), INSTR('hello world', 'WORLD');
+    '''
+    testFoldConst('''
+        SELECT INSTR('hello world', 'world'), INSTR('hello world', 'WORLD');
+    ''')
+
+    qt_instr_null '''
+        SELECT INSTR(NULL, 'test'), INSTR('test', NULL);
+    '''
+    testFoldConst('''
+        SELECT INSTR(NULL, 'test'), INSTR('test', NULL);
+    ''')
+
+    qt_instr_empty '''
+        SELECT INSTR('hello', ''), INSTR('', 'world');
+    '''
+    testFoldConst('''
+        SELECT INSTR('hello', ''), INSTR('', 'world');
+    ''')
+
+    qt_instr_repeated '''
+        SELECT INSTR('abcabc', 'abc'), INSTR('banana', 'a');
+    '''
+    testFoldConst('''
+        SELECT INSTR('abcabc', 'abc'), INSTR('banana', 'a');
+    ''')
+
+    qt_instr_special '''
+        SELECT INSTR('[email protected]', '@'), INSTR('price: $99.99', '$');
+    '''
+    testFoldConst('''
+        SELECT INSTR('[email protected]', '@'), INSTR('price: $99.99', '$');
+    ''')
+
+    qt_instr_utf8 '''
+        SELECT INSTR('ṭṛì ḍḍumai hello', 'ḍḍumai'), INSTR('ṭṛì ḍḍumai hello', 
'hello');
+    '''
+    testFoldConst('''
+        SELECT INSTR('ṭṛì ḍḍumai hello', 'ḍḍumai'), INSTR('ṭṛì ḍḍumai hello', 
'hello');
+    ''')
+
+    qt_instr_digits '''
+        SELECT INSTR('123456789', '456'), INSTR('123-456-789', '-');
+    '''
+    testFoldConst('''
+        SELECT INSTR('123456789', '456'), INSTR('123-456-789', '-');
+    ''')
+
+    qt_instr_long '''
+        SELECT INSTR('The quick brown fox', 'quick'), INSTR('The quick brown 
fox', 'slow');
+    '''
+    testFoldConst('''
+        SELECT INSTR('The quick brown fox', 'quick'), INSTR('The quick brown 
fox', 'slow');
+    ''')
+
+    qt_instr_url '''
+        SELECT INSTR('/home/user/file.txt', '/'), 
INSTR('https://www.example.com', '://');
+    '''
+    testFoldConst('''
+        SELECT INSTR('/home/user/file.txt', '/'), 
INSTR('https://www.example.com', '://');
+    ''')
+
+    qt_length_ascii '''
+        SELECT LENGTH('abc'), CHAR_LENGTH('abc');
+    '''
+    testFoldConst('''
+        SELECT LENGTH('abc'), CHAR_LENGTH('abc');
+    ''')
+
+    qt_length_chinese '''
+        SELECT LENGTH('中国'), CHAR_LENGTH('中国');
+    '''
+    testFoldConst('''
+        SELECT LENGTH('中国'), CHAR_LENGTH('中国');
+    ''')
+
+    qt_length_null '''
+        SELECT LENGTH(NULL);
+    '''
+    testFoldConst('''
+        SELECT LENGTH(NULL);
+    ''')
+
+    qt_length_empty '''
+        SELECT LENGTH('');
+    '''
+    testFoldConst('''
+        SELECT LENGTH('');
+    ''')
+
+    qt_length_mixed '''
+        SELECT LENGTH('Hello世界'), CHAR_LENGTH('Hello世界');
+    '''
+    testFoldConst('''
+        SELECT LENGTH('Hello世界'), CHAR_LENGTH('Hello世界');
+    ''')
+
+    qt_length_special '''
+        SELECT LENGTH('\t\n\r'), LENGTH('  ');
+    '''
+    testFoldConst('''
+        SELECT LENGTH('\t\n\r'), LENGTH('  ');
+    ''')
+
+    qt_length_utf8 '''
+        SELECT LENGTH('ṭṛì'), CHAR_LENGTH('ṭṛì');
+    '''
+    testFoldConst('''
+        SELECT LENGTH('ṭṛì'), CHAR_LENGTH('ṭṛì');
+    ''')
+
+    qt_length_emoji '''
+        SELECT LENGTH('😀😁'), CHAR_LENGTH('😀😁');
+    '''
+    testFoldConst('''
+        SELECT LENGTH('😀😁'), CHAR_LENGTH('😀😁');
+    ''')
+
+    qt_length_digits '''
+        SELECT LENGTH('12345'), CHAR_LENGTH('12345');
+    '''
+    testFoldConst('''
+        SELECT LENGTH('12345'), CHAR_LENGTH('12345');
+    ''')
+
+    qt_locate_basic '''
+        SELECT LOCATE('bar', 'foobarbar'), LOCATE('xbar', 'foobar'), 
LOCATE('bar', 'foobarbar', 5);
+    '''
+    testFoldConst('''
+        SELECT LOCATE('bar', 'foobarbar'), LOCATE('xbar', 'foobar'), 
LOCATE('bar', 'foobarbar', 5);
+    ''')
+
+    qt_locate_first_last '''
+        SELECT LOCATE('f', 'foobar'), LOCATE('r', 'foobar');
+    '''
+    testFoldConst('''
+        SELECT LOCATE('f', 'foobar'), LOCATE('r', 'foobar');
+    ''')
+
+    qt_locate_not_found '''
+        SELECT LOCATE('xyz', 'foobar'), LOCATE('FOO', 'foobar');
+    '''
+    testFoldConst('''
+        SELECT LOCATE('xyz', 'foobar'), LOCATE('FOO', 'foobar');
+    ''')
+
+    qt_locate_null '''
+        SELECT LOCATE(NULL, 'foobar'), LOCATE('foo', NULL), LOCATE(NULL, NULL);
+    '''
+    testFoldConst('''
+        SELECT LOCATE(NULL, 'foobar'), LOCATE('foo', NULL), LOCATE(NULL, NULL);
+    ''')
+
+    qt_locate_empty '''
+        SELECT LOCATE('', 'foobar'), LOCATE('foo', ''), LOCATE('', '');
+    '''
+    testFoldConst('''
+        SELECT LOCATE('', 'foobar'), LOCATE('foo', ''), LOCATE('', '');
+    ''')
+
+    qt_locate_start_position '''
+        SELECT LOCATE('o', 'foobar', 1), LOCATE('o', 'foobar', 2), LOCATE('o', 
'foobar', 4);
+    '''
+    testFoldConst('''
+        SELECT LOCATE('o', 'foobar', 1), LOCATE('o', 'foobar', 2), LOCATE('o', 
'foobar', 4);
+    ''')
+
+    qt_locate_boundaries '''
+        SELECT LOCATE('foo', 'foobar', 0), LOCATE('foo', 'foobar', -1), 
LOCATE('foo', 'foobar', 10);
+    '''
+    testFoldConst('''
+        SELECT LOCATE('foo', 'foobar', 0), LOCATE('foo', 'foobar', -1), 
LOCATE('foo', 'foobar', 10);
+    ''')
+
+    qt_locate_utf8 '''
+        SELECT LOCATE('ṛì', 'ṭṛì ḍḍumai'), LOCATE('ḍḍu', 'ṭṛì ḍḍumai');
+    '''
+    testFoldConst('''
+        SELECT LOCATE('ṛì', 'ṭṛì ḍḍumai'), LOCATE('ḍḍu', 'ṭṛì ḍḍumai');
+    ''')
+
+    qt_locate_case_sensitive '''
+        SELECT LOCATE('BAR', 'foobar'), LOCATE('Bar', 'foobar'), LOCATE('bar', 
'fooBAR');
+    '''
+    testFoldConst('''
+        SELECT LOCATE('BAR', 'foobar'), LOCATE('Bar', 'foobar'), LOCATE('bar', 
'fooBAR');
+    ''')
+
+    qt_locate_empty_with_position '''
+        SELECT LOCATE('', 'foobar', 3), LOCATE('', 'foobar', 7), LOCATE('', 
'', 1);
+    '''
+    testFoldConst('''
+        SELECT LOCATE('', 'foobar', 3), LOCATE('', 'foobar', 7), LOCATE('', 
'', 1);
+    ''')
+
+    qt_lpad_basic '''
+        SELECT LPAD('hi', 5, 'xy'), LPAD('hello', 8, '*');
+    '''
+    testFoldConst('''
+        SELECT LPAD('hi', 5, 'xy'), LPAD('hello', 8, '*');
+    ''')
+
+    qt_lpad_truncate '''
+        SELECT LPAD('hi', 1, 'xy'), LPAD('hello world', 5, 'x');
+    '''
+    testFoldConst('''
+        SELECT LPAD('hi', 1, 'xy'), LPAD('hello world', 5, 'x');
+    ''')
+
+    qt_lpad_null '''
+        SELECT LPAD(NULL, 5, 'x'), LPAD('hi', NULL, 'x'), LPAD('hi', 5, NULL);
+    '''
+    testFoldConst('''
+        SELECT LPAD(NULL, 5, 'x'), LPAD('hi', NULL, 'x'), LPAD('hi', 5, NULL);
+    ''')
+
+    qt_lpad_empty_zero '''
+        SELECT LPAD('', 0, ''), LPAD('hi', 0, 'x'), LPAD('', 5, '*');
+    '''
+    testFoldConst('''
+        SELECT LPAD('', 0, ''), LPAD('hi', 0, 'x'), LPAD('', 5, '*');
+    ''')
+
+    qt_lpad_empty_pad '''
+        SELECT LPAD('hello', 10, ''), LPAD('hi', 2, '');
+    '''
+    testFoldConst('''
+        SELECT LPAD('hello', 10, ''), LPAD('hi', 2, '');
+    ''')
+
+    qt_lpad_long_pad '''
+        SELECT LPAD('123', 10, 'abc'), LPAD('X', 7, 'HELLO');
+    '''
+    testFoldConst('''
+        SELECT LPAD('123', 10, 'abc'), LPAD('X', 7, 'HELLO');
+    ''')
+
+    qt_lpad_utf8 '''
+        SELECT LPAD('hello', 10, 'ṭṛì'), LPAD('ḍḍumai', 3, 'x');
+    '''
+    testFoldConst('''
+        SELECT LPAD('hello', 10, 'ṭṛì'), LPAD('ḍḍumai', 3, 'x');
+    ''')
+
+    qt_lpad_numeric '''
+        SELECT LPAD('42', 6, '0'), LPAD('1234', 8, '0');
+    '''
+    testFoldConst('''
+        SELECT LPAD('42', 6, '0'), LPAD('1234', 8, '0');
+    ''')
+
+    qt_lpad_negative '''
+        SELECT LPAD('hello', -1, 'x'), LPAD('test', -5, '*');
+    '''
+    testFoldConst('''
+        SELECT LPAD('hello', -1, 'x'), LPAD('test', -5, '*');
+    ''')
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to