morningman commented on code in PR #24721:
URL: https://github.com/apache/doris/pull/24721#discussion_r1336076192


##########
be/src/vec/data_types/serde/data_type_hll_serde.cpp:
##########
@@ -37,21 +37,31 @@ namespace doris {
 namespace vectorized {
 class IColumn;
 
-void DataTypeHLLSerDe::serialize_column_to_json(const IColumn& column, int 
start_idx, int end_idx,
-                                                BufferWritable& bw, 
FormatOptions& options) const {
-    SERIALIZE_COLUMN_TO_JSON()
+Status DataTypeHLLSerDe::serialize_column_to_json(const IColumn& column, int 
start_idx, int end_idx,
+                                                  BufferWritable& bw, 
FormatOptions& options,
+                                                  int nesting_level) const {
+    SERIALIZE_COLUMN_TO_JSON();
 }
 
-void DataTypeHLLSerDe::serialize_one_cell_to_json(const IColumn& column, int 
row_num,
-                                                  BufferWritable& bw,
-                                                  FormatOptions& options) 
const {
+Status DataTypeHLLSerDe::serialize_one_cell_to_json(const IColumn& column, int 
row_num,
+                                                    BufferWritable& bw, 
FormatOptions& options,
+                                                    int nesting_level) const {
+    if (!options._output_object_data) {
+        if (nesting_level >= 2) {

Review Comment:
   Add some comment for this `if`



##########
be/src/vec/data_types/serde/data_type_nullable_serde.cpp:
##########
@@ -38,26 +38,32 @@ namespace doris {
 namespace vectorized {
 class Arena;
 
-void DataTypeNullableSerDe::serialize_column_to_json(const IColumn& column, 
int start_idx,
-                                                     int end_idx, 
BufferWritable& bw,
-                                                     FormatOptions& options) 
const {
-    SERIALIZE_COLUMN_TO_JSON()
+Status DataTypeNullableSerDe::serialize_column_to_json(const IColumn& column, 
int start_idx,
+                                                       int end_idx, 
BufferWritable& bw,
+                                                       FormatOptions& options,
+                                                       int nesting_level) 
const {
+    SERIALIZE_COLUMN_TO_JSON();
 }
 
-void DataTypeNullableSerDe::serialize_one_cell_to_json(const IColumn& column, 
int row_num,
-                                                       BufferWritable& bw,
-                                                       FormatOptions& options) 
const {
+Status DataTypeNullableSerDe::serialize_one_cell_to_json(const IColumn& 
column, int row_num,
+                                                         BufferWritable& bw, 
FormatOptions& options,
+                                                         int nesting_level) 
const {
     auto result = check_column_const_set_readability(column, row_num);
     ColumnPtr ptr = result.first;
     row_num = result.second;
 
     const auto& col_null = assert_cast<const ColumnNullable&>(*ptr);
     if (col_null.is_null_at(row_num)) {
-        bw.write("NULL", 4);
+        if (nesting_level >= 2) {
+            bw.write("null", 4);
+        } else {
+            bw.write("\\N", 2);

Review Comment:
   There is a define `VCSVTransformer::NULL_IN_CSV`, how about use that?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to