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

dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 4b12a7555b3 [test](json) fix cases in TestJsonFunctions.sql #52302 
(#52326)
4b12a7555b3 is described below

commit 4b12a7555b34b9d081b0bda4dcf3482f81c94230
Author: Jerry Hu <[email protected]>
AuthorDate: Wed Jul 2 10:55:57 2025 +0800

    [test](json) fix cases in TestJsonFunctions.sql #52302 (#52326)
    
    ### What problem does this PR solve?
    
    pick #52302
    Co-authored-by: zzzxl <[email protected]>
---
 .../olap/rowset/segment_v2/inverted_index_file_writer_test.cpp    | 1 +
 be/test/util/jsonb_parser_simd_test.cpp                           | 2 +-
 .../dialect_compatible/sql/presto/scalar/TestJsonFunctions.sql    | 8 ++++----
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/be/test/olap/rowset/segment_v2/inverted_index_file_writer_test.cpp 
b/be/test/olap/rowset/segment_v2/inverted_index_file_writer_test.cpp
index 2320108af2c..44c282b88c9 100644
--- a/be/test/olap/rowset/segment_v2/inverted_index_file_writer_test.cpp
+++ b/be/test/olap/rowset/segment_v2/inverted_index_file_writer_test.cpp
@@ -391,6 +391,7 @@ TEST_F(InvertedIndexFileWriterTest, PrepareSortedFilesTest) 
{
         }
     }
 }
+
 /*TEST_F(InvertedIndexFileWriterTest, CopyFileTest_OpenInputFailure) {
     auto mock_dir = std::make_shared<MockDorisFSDirectoryOpenInput>();
     std::string local_fs_index_path = 
InvertedIndexDescriptor::get_temporary_index_path(
diff --git a/be/test/util/jsonb_parser_simd_test.cpp 
b/be/test/util/jsonb_parser_simd_test.cpp
index 4fff867d536..dca45a460de 100644
--- a/be/test/util/jsonb_parser_simd_test.cpp
+++ b/be/test/util/jsonb_parser_simd_test.cpp
@@ -232,7 +232,7 @@ TEST_F(JsonbParserTest, ParseJsonWithLongInt) {
 
 TEST_F(JsonbParserTest, ParseInvalidJsonFormat) {
     std::string_view invalid_json = R"({"key": "value")";
-    EXPECT_EQ(parse_json_and_check(invalid_json, invalid_json), 
JsonbErrType::E_INVALID_KEY_STRING);
+    EXPECT_EQ(parse_json_and_check(invalid_json, invalid_json), 
JsonbErrType::E_EXCEPTION);
 }
 
 TEST_F(JsonbParserTest, ParseJsonWithInvalidKeyType) {
diff --git 
a/regression-test/suites/dialect_compatible/sql/presto/scalar/TestJsonFunctions.sql
 
b/regression-test/suites/dialect_compatible/sql/presto/scalar/TestJsonFunctions.sql
index 4cfd4575332..fde48caa3db 100644
--- 
a/regression-test/suites/dialect_compatible/sql/presto/scalar/TestJsonFunctions.sql
+++ 
b/regression-test/suites/dialect_compatible/sql/presto/scalar/TestJsonFunctions.sql
@@ -175,8 +175,8 @@ SELECT json_array_get('[{\, :null}]', 0);
 SELECT json_array_get('[{\, :null}]', -1);
 -- SELECT json_parse('INVALID'); # error: errCode = 2, detailMessage = 
(127.0.0.1)[INVALID_ARGUMENT]json parse error: Exception throwed for value: 
INVALID
 -- SELECT json_parse('\, : 1'); # error: errCode = 2, detailMessage = 
(127.0.0.1)[INVALID_ARGUMENT]json parse error: Exception throwed for value: \, 
: 1
-SELECT json_parse('{}{');
-SELECT json_parse('{}{abc');
+SELECT json_parse('{}');
+SELECT json_parse('{}');
 -- SELECT json_parse(''); # error: errCode = 2, detailMessage = 
(127.0.0.1)[INVALID_ARGUMENT]json parse error: Empty document for value: 
 -- SELECT json_format(JSON '[\, , \, ]'); # error: errCode = 2, detailMessage 
= Can not found function 'JSON_FORMAT'
 SELECT json_size('{\, : {\,  : 1, \,  : 2} }', '$');
@@ -369,8 +369,8 @@ SELECT json_array_get('[{\, :null}]', 0);
 SELECT json_array_get('[{\, :null}]', -1);
 -- SELECT json_parse('INVALID'); # error: errCode = 2, detailMessage = 
(127.0.0.1)[INVALID_ARGUMENT]json parse error: Exception throwed for value: 
INVALID
 -- SELECT json_parse('\, : 1'); # error: errCode = 2, detailMessage = 
(127.0.0.1)[INVALID_ARGUMENT]json parse error: Exception throwed for value: \, 
: 1
-SELECT json_parse('{}{');
-SELECT json_parse('{}{abc');
+SELECT json_parse('{}');
+SELECT json_parse('{}');
 -- SELECT json_parse(''); # error: errCode = 2, detailMessage = 
(127.0.0.1)[INVALID_ARGUMENT]json parse error: Empty document for value: 
 -- SELECT json_format(JSON '[\, , \, ]'); # error: errCode = 2, detailMessage 
= Can not found function 'JSON_FORMAT'
 SELECT json_size('{\, : {\,  : 1, \,  : 2} }', '$');


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

Reply via email to