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

yiguolei 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 18beb822a3 [FIX](array-type) fix array string output with fe const 
expr (#21042)
18beb822a3 is described below

commit 18beb822a39752a9c9ce7ce3aabd0c7c8119ea24
Author: amory <wangqian...@selectdb.com>
AuthorDate: Wed Jun 21 11:52:02 2023 +0800

    [FIX](array-type) fix array string output with fe const expr (#21042)
    
    fe foldconstRule make array() function expr with const literal , and would 
not pass this array literal to be . but we should make fe array string output 
format is same with be array string output
---
 .../src/main/java/org/apache/doris/common/util/LiteralUtils.java      | 2 +-
 .../data/query_p0/sql_functions/array_functions/sql/q02.out           | 4 ++--
 .../sql_functions/array_functions/test_array_functions_by_literal.out | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/common/util/LiteralUtils.java 
b/fe/fe-core/src/main/java/org/apache/doris/common/util/LiteralUtils.java
index 990dd194ce..406ab51389 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/common/util/LiteralUtils.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/common/util/LiteralUtils.java
@@ -50,7 +50,7 @@ public class LiteralUtils {
             } else if (v instanceof DecimalLiteral) {
                 list.add(((DecimalLiteral) v).getValue().toPlainString());
             } else if (v instanceof StringLiteral) {
-                list.add("'" + v.getStringValue() + "'");
+                list.add("\"" + v.getStringValue() + "\"");
             } else if (v instanceof ArrayLiteral) {
                 list.add(getStringValue((ArrayLiteral) v));
             } else {
diff --git 
a/regression-test/data/query_p0/sql_functions/array_functions/sql/q02.out 
b/regression-test/data/query_p0/sql_functions/array_functions/sql/q02.out
index 0666bf7369..7e5cac6f73 100644
--- a/regression-test/data/query_p0/sql_functions/array_functions/sql/q02.out
+++ b/regression-test/data/query_p0/sql_functions/array_functions/sql/q02.out
@@ -21,7 +21,7 @@
 [-1000000, 2]
 
 -- !q02_8 --
-['Hello', 'world']
+["Hello", "world"]
 
 -- !q02_9 --
 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 
22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 
42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 
62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 
82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 
101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 
117, 118, 119, 1 [...]
@@ -45,5 +45,5 @@
 [0]
 
 -- !q02_16 --
-[[['2']], [['aa'], ['2.0', '1.0']]]
+[[["2"]], [["aa"], ["2.0", "1.0"]]]
 
diff --git 
a/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions_by_literal.out
 
b/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions_by_literal.out
index cdec471b73..6d2e316090 100644
--- 
a/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions_by_literal.out
+++ 
b/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions_by_literal.out
@@ -747,7 +747,7 @@ _
 [8, NULL]
 
 -- !sql --
-['a', '1', '2']
+["a", "1", "2"]
 
 -- !sql --
 [NULL, NULL, NULL]


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

Reply via email to