You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2022/07/26 11:58:45 UTC

[doris] branch dev-1.1.2 updated (2dbd70bf92 -> 1cde8cd819)

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

yiguolei pushed a change to branch dev-1.1.2
in repository https://gitbox.apache.org/repos/asf/doris.git


    from 2dbd70bf92 1.1.1 rc03 (#11161)
     new 3fc0ba91dc [bug]string pad functions should always be nullable (#11140)
     new 1cde8cd819 [FIX]string pad function should be always nullable for both string and varchar type (#11196)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 gensrc/script/doris_builtins_functions.py          |  4 +--
 ..._timestamp.out => test_string_pad_function.out} | 10 +++---
 .../test_string_pad_function.groovy}               | 37 +++++++++++-----------
 3 files changed, 27 insertions(+), 24 deletions(-)
 copy regression-test/data/correctness/{test_current_timestamp.out => test_string_pad_function.out} (63%)
 copy regression-test/suites/{performance/redundant_conjuncts.groovy => correctness/test_string_pad_function.groovy} (57%)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[doris] 01/02: [bug]string pad functions should always be nullable (#11140)

Posted by yi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch dev-1.1.2
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 3fc0ba91dcfb5af771325a7c4ee79474a838ea9f
Author: starocean999 <40...@users.noreply.github.com>
AuthorDate: Tue Jul 26 10:20:11 2022 +0800

    [bug]string pad functions should always be nullable (#11140)
    
    * string pad functions should always be nullable
---
 .../data/correctness/test_string_pad_function.out  |  9 +++++
 .../correctness/test_string_pad_function.groovy    | 46 ++++++++++++++++++++++
 2 files changed, 55 insertions(+)

diff --git a/regression-test/data/correctness/test_string_pad_function.out b/regression-test/data/correctness/test_string_pad_function.out
new file mode 100644
index 0000000000..5fc247c7d7
--- /dev/null
+++ b/regression-test/data/correctness/test_string_pad_function.out
@@ -0,0 +1,9 @@
+-- This file is automatically generated. You should know what you did if you want to edit this
+-- !select_lpad --
+\N
+10:00
+
+-- !select_rpad --
+\N
+10:00
+
diff --git a/regression-test/suites/correctness/test_string_pad_function.groovy b/regression-test/suites/correctness/test_string_pad_function.groovy
new file mode 100644
index 0000000000..929a71dfa5
--- /dev/null
+++ b/regression-test/suites/correctness/test_string_pad_function.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("test_string_pad_function") {
+    sql """
+        drop table if exists table_pad;
+    """
+    
+    sql """
+        create table table_pad (
+        a int not null,
+        b varchar(10) not null
+        )
+        ENGINE=OLAP
+        distributed by hash(a)
+        properties(
+        'replication_num' = '1'
+        );
+    """
+
+    sql """
+        insert into table_pad values(1,'100000'), (2,'200000');
+    """
+
+    qt_select_lpad """
+        select CASE WHEN table_pad.a = 1 THEN CONCAT(LPAD(b, 2, 0), ':00') END result from table_pad order by result;
+    """
+
+    qt_select_rpad """
+        select CASE WHEN table_pad.a = 1 THEN CONCAT(RPAD(b, 2, 0), ':00') END result from table_pad order by result;
+    """
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[doris] 02/02: [FIX]string pad function should be always nullable for both string and varchar type (#11196)

Posted by yi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch dev-1.1.2
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 1cde8cd81985f4a519541c76821aa95d2d98b5a2
Author: starocean999 <40...@users.noreply.github.com>
AuthorDate: Tue Jul 26 17:55:06 2022 +0800

    [FIX]string pad function should be always nullable for both string and varchar type (#11196)
---
 gensrc/script/doris_builtins_functions.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gensrc/script/doris_builtins_functions.py b/gensrc/script/doris_builtins_functions.py
index 0a3d138b63..2c44b50737 100755
--- a/gensrc/script/doris_builtins_functions.py
+++ b/gensrc/script/doris_builtins_functions.py
@@ -976,10 +976,10 @@ visible_functions = [
         '15FunctionContextERKNS1_9StringValERKNS1_6IntValE', '', '', 'vec', ''],
     [['lpad'], 'STRING', ['STRING', 'INT', 'STRING'],
             '_ZN5doris15StringFunctions4lpadEPN9doris_udf'
-            '15FunctionContextERKNS1_9StringValERKNS1_6IntValES6_', '', '', 'vec', ''],
+            '15FunctionContextERKNS1_9StringValERKNS1_6IntValES6_', '', '', 'vec', 'ALWAYS_NULLABLE'],
     [['rpad'], 'STRING', ['STRING', 'INT', 'STRING'],
             '_ZN5doris15StringFunctions4rpadEPN9doris_udf'
-            '15FunctionContextERKNS1_9StringValERKNS1_6IntValES6_', '', '', 'vec', ''],
+            '15FunctionContextERKNS1_9StringValERKNS1_6IntValES6_', '', '', 'vec', 'ALWAYS_NULLABLE'],
     [['append_trailing_char_if_absent'], 'STRING', ['STRING', 'STRING'],
 	        '_ZN5doris15StringFunctions30append_trailing_char_if_absentEPN9doris_udf15FunctionContextERKNS1_9StringValES6_',
 	        '', '', 'vec', 'ALWAYS_NULLABLE'],


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org