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 efb090be69e [cherry-pick](serde) Fix the behavior of serializing 
ip/date types nested in complex types (#48685)
efb090be69e is described below

commit efb090be69ea9084f780daf7ca6aa647d87404e2
Author: amory <[email protected]>
AuthorDate: Thu Mar 6 11:54:54 2025 +0800

    [cherry-pick](serde) Fix the behavior of serializing ip/date types nested 
in complex types (#48685)
    
    ### What problem does this PR solve?
    backport :
    https://github.com/apache/doris/pull/47889
    https://github.com/apache/doris/pull/48053
    Issue Number: close #xxx
    
    Co-authored-by: Dongyang Li <[email protected]>
---
 .../data_types/serde/data_type_date64_serde.cpp    |  25 +++-
 .../serde/data_type_datetimev2_serde.cpp           |  10 +-
 .../data_types/serde/data_type_datev2_serde.cpp    |   9 ++
 .../vec/data_types/serde/data_type_ipv4_serde.cpp  |   9 ++
 .../vec/data_types/serde/data_type_ipv6_serde.cpp  |  11 ++
 .../vec/data_types/common_data_type_serder_test.h  |  17 ++-
 be/test/vec/data_types/data_type_ip_test.cpp       | 128 ++++++++++++++++++++-
 .../data_types/serde/data_type_serde_text_test.cpp |  32 +++---
 .../outfile/csv/test_outfile_csv_array_type.out    | Bin 7168 -> 7204 bytes
 .../outfile/csv/test_outfile_csv_complex_type.out  | Bin 8537 -> 8577 bytes
 .../outfile/csv/test_outfile_csv_map_type.out      | Bin 13751 -> 13841 bytes
 11 files changed, 218 insertions(+), 23 deletions(-)

diff --git a/be/src/vec/data_types/serde/data_type_date64_serde.cpp 
b/be/src/vec/data_types/serde/data_type_date64_serde.cpp
index 4cdd6b90326..0624717d1dd 100644
--- a/be/src/vec/data_types/serde/data_type_date64_serde.cpp
+++ b/be/src/vec/data_types/serde/data_type_date64_serde.cpp
@@ -39,7 +39,9 @@ Status DataTypeDate64SerDe::serialize_one_cell_to_json(const 
IColumn& column, in
     auto result = check_column_const_set_readability(column, row_num);
     ColumnPtr ptr = result.first;
     row_num = result.second;
-
+    if (_nesting_level > 1) {
+        bw.write('"');
+    }
     Int64 int_val = assert_cast<const ColumnInt64&>(*ptr).get_element(row_num);
     if (options.date_olap_format) {
         tm time_tm;
@@ -58,6 +60,9 @@ Status DataTypeDate64SerDe::serialize_one_cell_to_json(const 
IColumn& column, in
         char* pos = value.to_string(buf);
         bw.write(buf, pos - buf - 1);
     }
+    if (_nesting_level > 1) {
+        bw.write('"');
+    }
     return Status::OK();
 }
 
@@ -71,6 +76,9 @@ Status 
DataTypeDate64SerDe::deserialize_column_from_json_vector(
 Status DataTypeDate64SerDe::deserialize_one_cell_from_json(IColumn& column, 
Slice& slice,
                                                            const 
FormatOptions& options) const {
     auto& column_data = assert_cast<ColumnInt64&>(column);
+    if (_nesting_level > 1) {
+        slice.trim_quote();
+    }
     Int64 val = 0;
     if (options.date_olap_format) {
         tm time_tm;
@@ -166,7 +174,7 @@ void DataTypeDate64SerDe::write_column_to_arrow(const 
IColumn& column, const Nul
     for (size_t i = start; i < end; ++i) {
         char buf[64];
         const VecDateTimeValue* time_val = (const 
VecDateTimeValue*)(&col_data[i]);
-        int len = time_val->to_buffer(buf);
+        size_t len = time_val->to_buffer(buf);
         if (null_map && (*null_map)[i]) {
             checkArrowStatus(string_builder.AppendNull(), column.get_name(),
                              array_builder->type()->name());
@@ -236,6 +244,19 @@ void DataTypeDate64SerDe::read_column_from_arrow(IColumn& 
column, const arrow::A
             v.cast_to_date();
             col_data.emplace_back(binary_cast<VecDateTimeValue, Int64>(v));
         }
+    } else if (arrow_array->type()->id() == arrow::Type::STRING) {
+        // to be compatible with old version, we use string type for date.
+        auto concrete_array = dynamic_cast<const 
arrow::StringArray*>(arrow_array);
+        for (size_t value_i = start; value_i < end; ++value_i) {
+            Int64 val = 0;
+            auto val_str = concrete_array->GetString(value_i);
+            ReadBuffer rb(val_str.data(), val_str.size());
+            read_datetime_text_impl(val, rb, ctz);
+            col_data.emplace_back(val);
+        }
+    } else {
+        throw doris::Exception(doris::ErrorCode::INVALID_ARGUMENT,
+                               "Unsupported Arrow Type: " + 
arrow_array->type()->name());
     }
 }
 
diff --git a/be/src/vec/data_types/serde/data_type_datetimev2_serde.cpp 
b/be/src/vec/data_types/serde/data_type_datetimev2_serde.cpp
index e231545ba5e..f073ac6decf 100644
--- a/be/src/vec/data_types/serde/data_type_datetimev2_serde.cpp
+++ b/be/src/vec/data_types/serde/data_type_datetimev2_serde.cpp
@@ -46,7 +46,9 @@ Status 
DataTypeDateTimeV2SerDe::serialize_one_cell_to_json(const IColumn& column
     auto result = check_column_const_set_readability(column, row_num);
     ColumnPtr ptr = result.first;
     row_num = result.second;
-
+    if (_nesting_level > 1) {
+        bw.write('"');
+    }
     UInt64 int_val =
             assert_cast<const ColumnUInt64&, 
TypeCheckOnRelease::DISABLE>(*ptr).get_element(
                     row_num);
@@ -65,6 +67,9 @@ Status 
DataTypeDateTimeV2SerDe::serialize_one_cell_to_json(const IColumn& column
         char* pos = val.to_string(buf);
         bw.write(buf, pos - buf - 1);
     }
+    if (_nesting_level > 1) {
+        bw.write('"');
+    }
     return Status::OK();
 }
 
@@ -77,6 +82,9 @@ Status 
DataTypeDateTimeV2SerDe::deserialize_column_from_json_vector(
 Status DataTypeDateTimeV2SerDe::deserialize_one_cell_from_json(IColumn& 
column, Slice& slice,
                                                                const 
FormatOptions& options) const {
     auto& column_data = assert_cast<ColumnUInt64&, 
TypeCheckOnRelease::DISABLE>(column);
+    if (_nesting_level > 1) {
+        slice.trim_quote();
+    }
     UInt64 val = 0;
     if (options.date_olap_format) {
         DateV2Value<DateTimeV2ValueType> datetimev2_value;
diff --git a/be/src/vec/data_types/serde/data_type_datev2_serde.cpp 
b/be/src/vec/data_types/serde/data_type_datev2_serde.cpp
index 95109ee408c..53427e8c69c 100644
--- a/be/src/vec/data_types/serde/data_type_datev2_serde.cpp
+++ b/be/src/vec/data_types/serde/data_type_datev2_serde.cpp
@@ -39,6 +39,9 @@ Status DataTypeDateV2SerDe::serialize_column_to_json(const 
IColumn& column, int
 Status DataTypeDateV2SerDe::serialize_one_cell_to_json(const IColumn& column, 
int row_num,
                                                        BufferWritable& bw,
                                                        FormatOptions& options) 
const {
+    if (_nesting_level > 1) {
+        bw.write('"');
+    }
     auto result = check_column_const_set_readability(column, row_num);
     ColumnPtr ptr = result.first;
     row_num = result.second;
@@ -50,6 +53,9 @@ Status DataTypeDateV2SerDe::serialize_one_cell_to_json(const 
IColumn& column, in
     char* pos = val.to_string(buf);
     // DateTime to_string the end is /0
     bw.write(buf, pos - buf - 1);
+    if (_nesting_level > 1) {
+        bw.write('"');
+    }
     return Status::OK();
 }
 
@@ -62,6 +68,9 @@ Status 
DataTypeDateV2SerDe::deserialize_column_from_json_vector(
 
 Status DataTypeDateV2SerDe::deserialize_one_cell_from_json(IColumn& column, 
Slice& slice,
                                                            const 
FormatOptions& options) const {
+    if (_nesting_level > 1) {
+        slice.trim_quote();
+    }
     auto& column_data = assert_cast<ColumnUInt32&>(column);
     UInt32 val = 0;
     if (options.date_olap_format) {
diff --git a/be/src/vec/data_types/serde/data_type_ipv4_serde.cpp 
b/be/src/vec/data_types/serde/data_type_ipv4_serde.cpp
index a2661fa2036..430f02b1bb5 100644
--- a/be/src/vec/data_types/serde/data_type_ipv4_serde.cpp
+++ b/be/src/vec/data_types/serde/data_type_ipv4_serde.cpp
@@ -69,6 +69,9 @@ Status DataTypeIPv4SerDe::write_column_to_mysql(const 
IColumn& column,
 Status DataTypeIPv4SerDe::serialize_one_cell_to_json(const IColumn& column, 
int row_num,
                                                      BufferWritable& bw,
                                                      FormatOptions& options) 
const {
+    if (_nesting_level > 1) {
+        bw.write('"');
+    }
     auto result = check_column_const_set_readability(column, row_num);
     ColumnPtr ptr = result.first;
     row_num = result.second;
@@ -76,11 +79,17 @@ Status DataTypeIPv4SerDe::serialize_one_cell_to_json(const 
IColumn& column, int
     IPv4Value ipv4_value(data);
     std::string ipv4_str = ipv4_value.to_string();
     bw.write(ipv4_str.c_str(), ipv4_str.length());
+    if (_nesting_level > 1) {
+        bw.write('"');
+    }
     return Status::OK();
 }
 
 Status DataTypeIPv4SerDe::deserialize_one_cell_from_json(IColumn& column, 
Slice& slice,
                                                          const FormatOptions& 
options) const {
+    if (_nesting_level > 1) {
+        slice.trim_quote();
+    }
     auto& column_data = reinterpret_cast<ColumnIPv4&>(column);
     ReadBuffer rb(slice.data, slice.size);
     IPv4 val = 0;
diff --git a/be/src/vec/data_types/serde/data_type_ipv6_serde.cpp 
b/be/src/vec/data_types/serde/data_type_ipv6_serde.cpp
index 468565ad2d2..9c31c74dee5 100644
--- a/be/src/vec/data_types/serde/data_type_ipv6_serde.cpp
+++ b/be/src/vec/data_types/serde/data_type_ipv6_serde.cpp
@@ -89,6 +89,9 @@ void DataTypeIPv6SerDe::write_one_cell_to_jsonb(const 
IColumn& column,
 Status DataTypeIPv6SerDe::serialize_one_cell_to_json(const IColumn& column, 
int row_num,
                                                      BufferWritable& bw,
                                                      FormatOptions& options) 
const {
+    if (_nesting_level > 1) {
+        bw.write('"');
+    }
     auto result = check_column_const_set_readability(column, row_num);
     ColumnPtr ptr = result.first;
     row_num = result.second;
@@ -96,11 +99,17 @@ Status DataTypeIPv6SerDe::serialize_one_cell_to_json(const 
IColumn& column, int
     IPv6Value ipv6_value(data);
     std::string ipv6_str = ipv6_value.to_string();
     bw.write(ipv6_str.c_str(), ipv6_str.length());
+    if (_nesting_level > 1) {
+        bw.write('"');
+    }
     return Status::OK();
 }
 
 Status DataTypeIPv6SerDe::deserialize_one_cell_from_json(IColumn& column, 
Slice& slice,
                                                          const FormatOptions& 
options) const {
+    if (_nesting_level > 1) {
+        slice.trim_quote();
+    }
     auto& column_data = reinterpret_cast<ColumnIPv6&>(column);
     ReadBuffer rb(slice.data, slice.size);
     IPv6 val = 0;
@@ -172,6 +181,8 @@ void DataTypeIPv6SerDe::read_column_from_arrow(IColumn& 
column, const arrow::Arr
                                        std::string(raw_data, 
raw_data_len).c_str());
             }
             col_data.emplace_back(ipv6_val);
+        } else {
+            col_data.emplace_back(0);
         }
     }
 }
diff --git a/be/test/vec/data_types/common_data_type_serder_test.h 
b/be/test/vec/data_types/common_data_type_serder_test.h
index 46206d5ed7e..a970cda7fbc 100644
--- a/be/test/vec/data_types/common_data_type_serder_test.h
+++ b/be/test/vec/data_types/common_data_type_serder_test.h
@@ -24,6 +24,8 @@
 #include <fstream>
 #include <iostream>
 
+#include "arrow/array/array_base.h"
+#include "arrow/type.h"
 #include "olap/schema.h"
 #include "runtime/descriptors.cpp"
 #include "runtime/descriptors.h"
@@ -40,6 +42,7 @@
 #include "vec/data_types/data_type.h"
 #include "vec/data_types/data_type_array.h"
 #include "vec/data_types/data_type_map.h"
+#include "vec/runtime/ipv6_value.h"
 #include "vec/utils/arrow_column_to_doris_column.h"
 
 // this test is gonna to be a data type serialize and deserialize functions
@@ -342,15 +345,25 @@ public:
         auto rows = block->rows();
         for (size_t i = 0; i < load_cols.size(); ++i) {
             auto array = result->column(i);
+            std::cout << array.get()->ToString() << std::endl;
             auto& column_with_type_and_name = assert_block.get_by_position(i);
+            std::cout << "now we are testing column: "
+                      << column_with_type_and_name.column->get_name() << 
std::endl;
             auto ret = arrow_column_to_doris_column(
                     array.get(), 0, column_with_type_and_name.column,
                     column_with_type_and_name.type, rows, _timezone_obj);
             // do check data
+            std::cout << "arrow_column_to_doris_column done: "
+                      << column_with_type_and_name.column->get_name()
+                      << " with column size: " << 
column_with_type_and_name.column->size()
+                      << std::endl;
             EXPECT_EQ(Status::OK(), ret) << "convert arrow to block failed" << 
ret.to_string();
             auto& col = block->get_by_position(i).column;
             auto& assert_col = column_with_type_and_name.column;
-            for (size_t j = 0; j < col->size(); ++j) {
+            std::cout << "column: " << col->get_name() << " size: " << 
col->size()
+                      << " assert size: " << assert_col->size() << std::endl;
+            EXPECT_EQ(assert_col->size(), col->size());
+            for (size_t j = 0; j < assert_col->size(); ++j) {
                 auto cell = col->operator[](j);
                 auto assert_cell = assert_col->operator[](j);
                 EXPECT_EQ(cell, assert_cell) << "column: " << col->get_name() 
<< " row: " << j;
@@ -363,4 +376,4 @@ public:
     // can just be replaced by jsonb format
 };
 
-} // namespace doris::vectorized
\ No newline at end of file
+} // namespace doris::vectorized
diff --git a/be/test/vec/data_types/data_type_ip_test.cpp 
b/be/test/vec/data_types/data_type_ip_test.cpp
index 91ae064e447..3bd91102d13 100644
--- a/be/test/vec/data_types/data_type_ip_test.cpp
+++ b/be/test/vec/data_types/data_type_ip_test.cpp
@@ -37,6 +37,7 @@
 #include "vec/data_types/data_type.h"
 #include "vec/data_types/data_type_factory.hpp"
 #include "vec/data_types/data_type_nullable.h"
+#include "vec/data_types/data_type_struct.h"
 
 // this test is gonna to be a data type test template for all DataType which 
should make ut test to coverage the function defined
 // for example DataTypeIPv4 should test this function:
@@ -157,7 +158,7 @@ TEST_F(DataTypeIPTest, GetFieldTest) {
     node_ipv6.node_type = TExprNodeType::IPV6_LITERAL;
     for (size_t i = 0; i < ip_cols[1]->size(); ++i) {
         node_ipv6.ipv6_literal.value =
-                
IPv6Value::to_string(assert_cast<ColumnIPv6&>(*ip_cols[1]).get_data()[i]);
+                
doris::IPv6Value::to_string(assert_cast<ColumnIPv6&>(*ip_cols[1]).get_data()[i]);
         Field assert_field;
         ip_cols[1]->get(i, assert_field);
         get_field_assert(dt_ipv6, node_ipv6, assert_field);
@@ -249,4 +250,127 @@ TEST_F(DataTypeIPTest, SerdeJsonbTest) {
                                         
CommonDataTypeSerdeTest::assert_jsonb_format);
 }
 
-} // namespace doris::vectorized
\ No newline at end of file
+TEST_F(DataTypeIPTest, SerdeMysqlAndArrowTest) {
+    auto serde_ipv4 = dt_ipv4->get_serde(1);
+    auto serde_ipv6 = dt_ipv6->get_serde(1);
+    auto column_ipv4 = dt_ipv4->create_column();
+    auto column_ipv6 = dt_ipv6->create_column();
+
+    // insert from data csv and assert insert result
+    MutableColumns ip_cols;
+    ip_cols.push_back(column_ipv4->get_ptr());
+    ip_cols.push_back(column_ipv6->get_ptr());
+    DataTypeSerDeSPtrs serde = {dt_ipv4->get_serde(), dt_ipv6->get_serde()};
+    CommonDataTypeSerdeTest::check_data(ip_cols, serde, ';', {1, 2}, 
data_files[0],
+                                        
CommonDataTypeSerdeTest::assert_mysql_format);
+
+    CommonDataTypeSerdeTest::assert_arrow_format(ip_cols, serde, {dt_ipv4, 
dt_ipv6});
+}
+
+TEST_F(DataTypeIPTest, SerdeTOJsonInComplex) {
+    // make array<ip>
+    auto array_ipv4 = std::make_shared<DataTypeArray>(dt_ipv4);
+    auto array_ipv6 = std::make_shared<DataTypeArray>(dt_ipv6);
+    auto map_ipv4 = std::make_shared<DataTypeMap>(dt_ipv4, dt_ipv6);
+    auto map_ipv6 = std::make_shared<DataTypeMap>(dt_ipv6, dt_ipv4);
+    auto column_array_ipv4 = array_ipv4->create_column();
+    auto column_array_ipv6 = array_ipv6->create_column();
+    auto column_map_ipv4 = map_ipv4->create_column();
+    auto column_map_ipv6 = map_ipv6->create_column();
+    // struct
+    auto struct_ip = std::make_shared<DataTypeStruct>(std::vector<DataTypePtr> 
{
+            dt_ipv4, dt_ipv6, array_ipv4, array_ipv6, map_ipv4, map_ipv6});
+    auto column_struct_ip = struct_ip->create_column();
+
+    // insert some data into column
+    std::vector<string> ipv4_data = {"190.0.0.1", "127.0.0.1", "10.0.0.1"};
+    std::vector<string> ipv6_data = {"2001:db8::1234", "2001:db8::1234:5678", 
"::"};
+    std::vector<IPv4> ipv4_values;
+    std::vector<IPv6> ipv6_values;
+    // put data into column
+    for (size_t i = 0; i < ipv4_data.size(); ++i) {
+        IPv4 ipv4_val = 0;
+        IPv6 ipv6_val = 0;
+        IPv4Value::from_string(ipv4_val, ipv4_data[i]);
+        ipv4_values.push_back(ipv4_val);
+        IPv6Value::from_string(ipv6_val, ipv6_data[i]);
+        ipv6_values.push_back(ipv6_val);
+    }
+
+    // pack array ipv4
+    Array ipv4_array;
+    for (auto& ipv4 : ipv4_values) {
+        ipv4_array.push_back(ipv4);
+    }
+    column_array_ipv4->insert(ipv4_array);
+
+    // pack array ipv6
+    Array ipv6_array;
+    for (auto& ipv6 : ipv6_values) {
+        ipv6_array.push_back(ipv6);
+    }
+    column_array_ipv6->insert(ipv6_array);
+
+    Map ipv4_map;
+    // pack map ipv4
+    ipv4_map.push_back(ipv4_array);
+    ipv4_map.push_back(ipv6_array);
+    column_map_ipv4->insert(ipv4_map);
+
+    // pack map ipv6
+    Map ipv6_map;
+    ipv6_map.push_back(ipv6_array);
+    ipv6_map.push_back(ipv4_array);
+    column_map_ipv6->insert(ipv6_map);
+
+    // pack struct
+    Tuple tuple;
+    tuple.push_back(ipv4_values[0]);
+    tuple.push_back(ipv6_values[0]);
+    tuple.push_back(ipv4_array);
+    tuple.push_back(ipv6_array);
+    tuple.push_back(ipv4_map);
+    tuple.push_back(ipv6_map);
+    column_struct_ip->insert(tuple);
+
+    auto assert_func = [](DataTypePtr dt, MutableColumnPtr& col, string 
assert_json_str) {
+        // serde to json
+        auto from_serde = dt->get_serde(1);
+        auto dst_str = ColumnString::create();
+        dst_str->clear();
+        dst_str->reserve(1);
+        VectorBufferWriter write_buffer(*dst_str.get());
+        DataTypeSerDe::FormatOptions options;
+        options.escape_char = '\\';
+        auto st = from_serde->serialize_column_to_json(*col, 0, 1, 
write_buffer, options);
+        ASSERT_TRUE(st.ok());
+        write_buffer.commit();
+        StringRef json_str = dst_str->get_data_at(0);
+        // print
+        ASSERT_EQ(json_str.to_string(), assert_json_str);
+    };
+
+    std::vector<string> assert_json_arr_str = {
+            "[\"190.0.0.1\", \"127.0.0.1\", \"10.0.0.1\"]",
+            "[\"2001:db8::1234\", \"2001:db8::1234:5678\", \"::\"]"};
+    std::vector<string> assert_json_map_str = {
+            "{\"190.0.0.1\":\"2001:db8::1234\", 
\"127.0.0.1\":\"2001:db8::1234:5678\", "
+            "\"10.0.0.1\":\"::\"}",
+            "{\"2001:db8::1234\":\"190.0.0.1\", 
\"2001:db8::1234:5678\":\"127.0.0.1\", "
+            "\"::\":\"10.0.0.1\"}"};
+    string assert_json_struct_str =
+            "{\"1\": \"190.0.0.1\", \"2\": \"2001:db8::1234\", \"3\": 
[\"190.0.0.1\", "
+            "\"127.0.0.1\", \"10.0.0.1\"], \"4\": [\"2001:db8::1234\", 
\"2001:db8::1234:5678\", "
+            "\"::\"], \"5\": {\"190.0.0.1\":\"2001:db8::1234\", "
+            "\"127.0.0.1\":\"2001:db8::1234:5678\", \"10.0.0.1\":\"::\"}, 
\"6\": "
+            "{\"2001:db8::1234\":\"190.0.0.1\", 
\"2001:db8::1234:5678\":\"127.0.0.1\", "
+            "\"::\":\"10.0.0.1\"}}";
+
+    assert_func(array_ipv4, column_array_ipv4, assert_json_arr_str[0]);
+    assert_func(array_ipv6, column_array_ipv6, assert_json_arr_str[1]);
+    assert_func(map_ipv4, column_map_ipv4, assert_json_map_str[0]);
+    assert_func(map_ipv6, column_map_ipv6, assert_json_map_str[1]);
+    assert_func(struct_ip, column_struct_ip, assert_json_struct_str);
+}
+
+} // namespace doris::vectorized
diff --git a/be/test/vec/data_types/serde/data_type_serde_text_test.cpp 
b/be/test/vec/data_types/serde/data_type_serde_text_test.cpp
index 2affbc36c86..371142bdb60 100644
--- a/be/test/vec/data_types/serde/data_type_serde_text_test.cpp
+++ b/be/test/vec/data_types/serde/data_type_serde_text_test.cpp
@@ -399,14 +399,14 @@ TEST(TextSerde, ComplexTypeSerdeTextTest) {
                          "\"\\N\", "
                          "\"\x1\x2\x3,\\u0001bc\"]",
                          "[\"heeeee\", null, \"null\", \"\\N\", null, 
\"sssssssss\"]"}),
-                FieldType_RandStr(
-                        FieldType::OLAP_FIELD_TYPE_DATE,
-                        {"[\\\"2022-07-13\\\",\"2022-07-13 12:30:00\"]",
-                         "[2022-07-13 12:30:00, \"2022-07-13\"]",
-                         "[2022-07-13 12:30:00.000, 2022-07-13]"},
-                        {"[null, null]", "[2022-07-13, null]", "[2022-07-13, 
2022-07-13]"},
-                        {"[null, 2022-07-13]", "[2022-07-13, 2022-07-13]",
-                         "[2022-07-13, 2022-07-13]"}),
+                FieldType_RandStr(FieldType::OLAP_FIELD_TYPE_DATE,
+                                  {"[\\\"2022-07-13\\\",\"2022-07-13 
12:30:00\"]",
+                                   "[2022-07-13 12:30:00, \"2022-07-13\"]",
+                                   "[2022-07-13 12:30:00.000, 2022-07-13]"},
+                                  {"[null, \"2022-07-13\"]", "[\"2022-07-13\", 
\"2022-07-13\"]",
+                                   "[\"2022-07-13\", \"2022-07-13\"]"},
+                                  {"[null, \"2022-07-13\"]", "[\"2022-07-13\", 
\"2022-07-13\"]",
+                                   "[\"2022-07-13\", \"2022-07-13\"]"}),
                 FieldType_RandStr(
                         FieldType::OLAP_FIELD_TYPE_DATETIME,
                         {
@@ -594,10 +594,10 @@ TEST(TextSerde, ComplexTypeSerdeTextTest) {
                          "{2022-07-13 12\\:30\\:00: 2022-07-13, 2022-07-13 
12\\:30\\:00.000: "
                          "2022-07-13 12:30:00.000, 2022-07-13:\'2022-07-13 
12:30:00\'}",
                          "\\N"},
-                        {"{2022-07-13:2022-07-13 12:30:00, 2022-07-13:null, 
2022-07-13:null, "
-                         "null:null, 2022-07-13:null}",
-                         "{2022-07-13:2022-07-13 00:00:00, 
2022-07-13:2022-07-13 12:30:00, "
-                         "2022-07-13:null}",
+                        {"{\"2022-07-13\":2022-07-13 12:30:00, 
\"2022-07-13\":null, "
+                         "\"2022-07-13\":null, null:null, 
\"2022-07-13\":null}",
+                         "{\"2022-07-13\":2022-07-13 00:00:00, 
\"2022-07-13\":2022-07-13 12:30:00, "
+                         "\"2022-07-13\":null}",
                          "\\N"}),
                 FieldType_RandStr(
                         FieldType::OLAP_FIELD_TYPE_DATETIME, 
FieldType::OLAP_FIELD_TYPE_DECIMAL,
@@ -688,10 +688,10 @@ TEST(TextSerde, ComplexTypeSerdeTextTest) {
                          // escaped char ':'
                          "{2022-07-13 12\\:30\\:00: 2022-07-13, 2022-07-13 
12\\:30\\:00.000: "
                          "2022-07-13 12:30:00.000, 2022-07-13:\'2022-07-13 
12:30:00\'}"},
-                        {"{2022-07-13:2022-07-13 12:30:00, 2022-07-13:null, 
2022-07-13:null, "
-                         "null:null, 2022-07-13:2022-07-13 12:30:00}",
-                         "{2022-07-13:2022-07-13 00:00:00, 
2022-07-13:2022-07-13 12:30:00, "
-                         "2022-07-13:2022-07-13 12:30:00}"}),
+                        {"{\"2022-07-13\":2022-07-13 12:30:00, 
\"2022-07-13\":null, "
+                         "\"2022-07-13\":null, null:null, 
\"2022-07-13\":2022-07-13 12:30:00}",
+                         "{\"2022-07-13\":2022-07-13 00:00:00, 
\"2022-07-13\":2022-07-13 12:30:00, "
+                         "\"2022-07-13\":2022-07-13 12:30:00}"}),
                 FieldType_RandStr(
                         FieldType::OLAP_FIELD_TYPE_DATETIME, 
FieldType::OLAP_FIELD_TYPE_DECIMAL,
                         {"{2022-07-13 12:30:00: 12.45675432, 2022-07-13: 
12.45675432, null: null}",
diff --git 
a/regression-test/data/export_p0/outfile/csv/test_outfile_csv_array_type.out 
b/regression-test/data/export_p0/outfile/csv/test_outfile_csv_array_type.out
index aaa81062ac7..ad3e83cd45f 100644
Binary files 
a/regression-test/data/export_p0/outfile/csv/test_outfile_csv_array_type.out 
and 
b/regression-test/data/export_p0/outfile/csv/test_outfile_csv_array_type.out 
differ
diff --git 
a/regression-test/data/export_p0/outfile/csv/test_outfile_csv_complex_type.out 
b/regression-test/data/export_p0/outfile/csv/test_outfile_csv_complex_type.out
index c978a3758c9..c56a5c9fbf2 100644
Binary files 
a/regression-test/data/export_p0/outfile/csv/test_outfile_csv_complex_type.out 
and 
b/regression-test/data/export_p0/outfile/csv/test_outfile_csv_complex_type.out 
differ
diff --git 
a/regression-test/data/export_p0/outfile/csv/test_outfile_csv_map_type.out 
b/regression-test/data/export_p0/outfile/csv/test_outfile_csv_map_type.out
index 95dce04daae..69ed41b9c02 100644
Binary files 
a/regression-test/data/export_p0/outfile/csv/test_outfile_csv_map_type.out and 
b/regression-test/data/export_p0/outfile/csv/test_outfile_csv_map_type.out 
differ


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

Reply via email to