github-actions[bot] commented on code in PR #25946:
URL: https://github.com/apache/doris/pull/25946#discussion_r1372687081


##########
be/src/vec/data_types/serde/data_type_date64_serde.cpp:
##########
@@ -62,18 +61,15 @@ Status 
DataTypeDate64SerDe::serialize_one_cell_to_json(const IColumn& column, in
     return Status::OK();
 }
 
-Status DataTypeDate64SerDe::deserialize_column_from_json_vector(IColumn& 
column,
-                                                                
std::vector<Slice>& slices,
-                                                                int* 
num_deserialized,
-                                                                const 
FormatOptions& options,
-                                                                int 
nesting_level) const {
+Status DataTypeDate64SerDe::deserialize_column_from_json_vector(

Review Comment:
   warning: method 'deserialize_column_from_json_vector' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
   static Status DataTypeDate64SerDe::deserialize_column_from_json_vector(
   ```
   
   be/src/vec/data_types/serde/data_type_date64_serde.cpp:65:
   ```diff
   -         const FormatOptions& options) const {
   +         const FormatOptions& options) {
   ```
   



##########
be/src/vec/data_types/serde/data_type_date64_serde.cpp:
##########
@@ -130,18 +127,15 @@
     return Status::OK();
 }
 
-Status DataTypeDateTimeSerDe::deserialize_column_from_json_vector(IColumn& 
column,
-                                                                  
std::vector<Slice>& slices,
-                                                                  int* 
num_deserialized,
-                                                                  const 
FormatOptions& options,
-                                                                  int 
nesting_level) const {
+Status DataTypeDateTimeSerDe::deserialize_column_from_json_vector(

Review Comment:
   warning: method 'deserialize_column_from_json_vector' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
   static Status DataTypeDateTimeSerDe::deserialize_column_from_json_vector(
   ```
   
   be/src/vec/data_types/serde/data_type_date64_serde.cpp:131:
   ```diff
   -         const FormatOptions& options) const {
   +         const FormatOptions& options) {
   ```
   



##########
be/src/vec/data_types/serde/data_type_date64_serde.cpp:
##########
@@ -93,13 +89,14 @@
     return Status::OK();
 }
 
-Status DataTypeDateTimeSerDe::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()}
+Status DataTypeDateTimeSerDe::serialize_column_to_json(const IColumn& column, 
int start_idx,

Review Comment:
   warning: method 'serialize_column_to_json' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
   static Status DataTypeDateTimeSerDe::serialize_column_to_json(const IColumn& 
column, int start_idx,
   ```
   
   be/src/vec/data_types/serde/data_type_date64_serde.cpp:93:
   ```diff
   -                                                        FormatOptions& 
options) const {
   +                                                        FormatOptions& 
options) {
   ```
   



##########
be/src/vec/data_types/serde/data_type_serde.h:
##########
@@ -154,25 +156,25 @@
             // 13 (carriage return, CR, \r, ^M),
             // 27 (escape, ESC, \e [GCC only], ^[).
 
-            if (nesting_level == 1) {
+            if (hive_text_complex_type_delimiter_level == 1) {
                 ans = collection_delim;
-            } else if (nesting_level == 2) {
+            } else if (hive_text_complex_type_delimiter_level == 2) {
                 ans = map_key_delim;
-            } else if (nesting_level <= 7) {
+            } else if (hive_text_complex_type_delimiter_level <= 7) {
                 // [3, 7] -> [4, 8]
-                ans = nesting_level + 1;
-            } else if (nesting_level == 8) {
+                ans = hive_text_complex_type_delimiter_level + 1;
+            } else if (hive_text_complex_type_delimiter_level == 8) {
                 // [8] -> [11]
                 ans = 11;
-            } else if (nesting_level <= 21) {
+            } else if (hive_text_complex_type_delimiter_level <= 21) {

Review Comment:
   warning: 21 is a magic number; consider replacing it with a named constant 
[readability-magic-numbers]
   ```cpp
               } else if (hive_text_complex_type_delimiter_level <= 21) {
                                                                    ^
   ```
   



##########
be/src/vec/data_types/serde/data_type_serde.h:
##########
@@ -154,25 +156,25 @@
             // 13 (carriage return, CR, \r, ^M),
             // 27 (escape, ESC, \e [GCC only], ^[).
 
-            if (nesting_level == 1) {
+            if (hive_text_complex_type_delimiter_level == 1) {
                 ans = collection_delim;
-            } else if (nesting_level == 2) {
+            } else if (hive_text_complex_type_delimiter_level == 2) {
                 ans = map_key_delim;
-            } else if (nesting_level <= 7) {
+            } else if (hive_text_complex_type_delimiter_level <= 7) {

Review Comment:
   warning: 7 is a magic number; consider replacing it with a named constant 
[readability-magic-numbers]
   ```cpp
               } else if (hive_text_complex_type_delimiter_level <= 7) {
                                                                    ^
   ```
   



##########
be/src/vec/data_types/serde/data_type_datetimev2_serde.cpp:
##########
@@ -60,17 +58,14 @@ Status 
DataTypeDateTimeV2SerDe::serialize_one_cell_to_json(const IColumn& column
     return Status::OK();
 }
 
-Status DataTypeDateTimeV2SerDe::deserialize_column_from_json_vector(IColumn& 
column,
-                                                                    
std::vector<Slice>& slices,
-                                                                    int* 
num_deserialized,
-                                                                    const 
FormatOptions& options,
-                                                                    int 
nesting_level) const {
+Status DataTypeDateTimeV2SerDe::deserialize_column_from_json_vector(

Review Comment:
   warning: method 'deserialize_column_from_json_vector' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
   static Status DataTypeDateTimeV2SerDe::deserialize_column_from_json_vector(
   ```
   
   be/src/vec/data_types/serde/data_type_datetimev2_serde.cpp:62:
   ```diff
   -         const FormatOptions& options) const {
   +         const FormatOptions& options) {
   ```
   



##########
be/src/vec/data_types/serde/data_type_serde.h:
##########
@@ -154,25 +156,25 @@
             // 13 (carriage return, CR, \r, ^M),
             // 27 (escape, ESC, \e [GCC only], ^[).
 
-            if (nesting_level == 1) {
+            if (hive_text_complex_type_delimiter_level == 1) {
                 ans = collection_delim;
-            } else if (nesting_level == 2) {
+            } else if (hive_text_complex_type_delimiter_level == 2) {
                 ans = map_key_delim;
-            } else if (nesting_level <= 7) {
+            } else if (hive_text_complex_type_delimiter_level <= 7) {
                 // [3, 7] -> [4, 8]
-                ans = nesting_level + 1;
-            } else if (nesting_level == 8) {
+                ans = hive_text_complex_type_delimiter_level + 1;
+            } else if (hive_text_complex_type_delimiter_level == 8) {
                 // [8] -> [11]
                 ans = 11;
-            } else if (nesting_level <= 21) {
+            } else if (hive_text_complex_type_delimiter_level <= 21) {
                 // [9, 21] -> [14, 26]
-                ans = nesting_level + 5;
-            } else if (nesting_level <= 25) {
+                ans = hive_text_complex_type_delimiter_level + 5;
+            } else if (hive_text_complex_type_delimiter_level <= 25) {
                 // [22, 25] -> [28, 31]
-                ans = nesting_level + 6;
-            } else if (nesting_level <= 153) {
+                ans = hive_text_complex_type_delimiter_level + 6;
+            } else if (hive_text_complex_type_delimiter_level <= 153) {
                 // [26, 153] -> [-128, -1]
-                ans = nesting_level + (-26 - 128);
+                ans = hive_text_complex_type_delimiter_level + (-26 - 128);

Review Comment:
   warning: 128 is a magic number; consider replacing it with a named constant 
[readability-magic-numbers]
   ```cpp
                   ans = hive_text_complex_type_delimiter_level + (-26 - 128);
                                                                         ^
   ```
   



##########
be/src/vec/data_types/serde/data_type_serde.h:
##########
@@ -154,25 +156,25 @@
             // 13 (carriage return, CR, \r, ^M),
             // 27 (escape, ESC, \e [GCC only], ^[).
 
-            if (nesting_level == 1) {
+            if (hive_text_complex_type_delimiter_level == 1) {
                 ans = collection_delim;
-            } else if (nesting_level == 2) {
+            } else if (hive_text_complex_type_delimiter_level == 2) {
                 ans = map_key_delim;
-            } else if (nesting_level <= 7) {
+            } else if (hive_text_complex_type_delimiter_level <= 7) {
                 // [3, 7] -> [4, 8]
-                ans = nesting_level + 1;
-            } else if (nesting_level == 8) {
+                ans = hive_text_complex_type_delimiter_level + 1;
+            } else if (hive_text_complex_type_delimiter_level == 8) {
                 // [8] -> [11]
                 ans = 11;
-            } else if (nesting_level <= 21) {
+            } else if (hive_text_complex_type_delimiter_level <= 21) {
                 // [9, 21] -> [14, 26]
-                ans = nesting_level + 5;
-            } else if (nesting_level <= 25) {
+                ans = hive_text_complex_type_delimiter_level + 5;
+            } else if (hive_text_complex_type_delimiter_level <= 25) {
                 // [22, 25] -> [28, 31]
-                ans = nesting_level + 6;
-            } else if (nesting_level <= 153) {
+                ans = hive_text_complex_type_delimiter_level + 6;
+            } else if (hive_text_complex_type_delimiter_level <= 153) {
                 // [26, 153] -> [-128, -1]
-                ans = nesting_level + (-26 - 128);
+                ans = hive_text_complex_type_delimiter_level + (-26 - 128);

Review Comment:
   warning: 26 is a magic number; consider replacing it with a named constant 
[readability-magic-numbers]
   ```cpp
                   ans = hive_text_complex_type_delimiter_level + (-26 - 128);
                                                                    ^
   ```
   



##########
be/src/vec/data_types/serde/data_type_datev2_serde.cpp:
##########
@@ -51,18 +50,15 @@ Status 
DataTypeDateV2SerDe::serialize_one_cell_to_json(const IColumn& column, in
     return Status::OK();
 }
 
-Status DataTypeDateV2SerDe::deserialize_column_from_json_vector(IColumn& 
column,
-                                                                
std::vector<Slice>& slices,
-                                                                int* 
num_deserialized,
-                                                                const 
FormatOptions& options,
-                                                                int 
nesting_level) const {
+Status DataTypeDateV2SerDe::deserialize_column_from_json_vector(

Review Comment:
   warning: method 'deserialize_column_from_json_vector' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
   static Status DataTypeDateV2SerDe::deserialize_column_from_json_vector(
   ```
   
   be/src/vec/data_types/serde/data_type_datev2_serde.cpp:54:
   ```diff
   -         const FormatOptions& options) const {
   +         const FormatOptions& options) {
   ```
   



##########
be/src/vec/data_types/serde/data_type_serde.h:
##########
@@ -141,8 +141,10 @@ class DataTypeSerDe {
          */
         bool _output_object_data = true;
 
-        [[nodiscard]] char get_collection_delimiter(int nesting_level) const {
-            CHECK(0 <= nesting_level && nesting_level <= 153);
+        [[nodiscard]] char get_collection_delimiter(
+                int hive_text_complex_type_delimiter_level) const {
+            CHECK(0 <= hive_text_complex_type_delimiter_level &&
+                  hive_text_complex_type_delimiter_level <= 153);

Review Comment:
   warning: 153 is a magic number; consider replacing it with a named constant 
[readability-magic-numbers]
   ```cpp
                     hive_text_complex_type_delimiter_level <= 153);
                                                               ^
   ```
   



##########
be/src/vec/data_types/serde/data_type_serde.h:
##########
@@ -154,25 +156,25 @@
             // 13 (carriage return, CR, \r, ^M),
             // 27 (escape, ESC, \e [GCC only], ^[).
 
-            if (nesting_level == 1) {
+            if (hive_text_complex_type_delimiter_level == 1) {
                 ans = collection_delim;
-            } else if (nesting_level == 2) {
+            } else if (hive_text_complex_type_delimiter_level == 2) {
                 ans = map_key_delim;
-            } else if (nesting_level <= 7) {
+            } else if (hive_text_complex_type_delimiter_level <= 7) {
                 // [3, 7] -> [4, 8]
-                ans = nesting_level + 1;
-            } else if (nesting_level == 8) {
+                ans = hive_text_complex_type_delimiter_level + 1;
+            } else if (hive_text_complex_type_delimiter_level == 8) {
                 // [8] -> [11]
                 ans = 11;
-            } else if (nesting_level <= 21) {
+            } else if (hive_text_complex_type_delimiter_level <= 21) {
                 // [9, 21] -> [14, 26]
-                ans = nesting_level + 5;
-            } else if (nesting_level <= 25) {
+                ans = hive_text_complex_type_delimiter_level + 5;
+            } else if (hive_text_complex_type_delimiter_level <= 25) {
                 // [22, 25] -> [28, 31]
-                ans = nesting_level + 6;
-            } else if (nesting_level <= 153) {
+                ans = hive_text_complex_type_delimiter_level + 6;

Review Comment:
   warning: 6 is a magic number; consider replacing it with a named constant 
[readability-magic-numbers]
   ```cpp
                   ans = hive_text_complex_type_delimiter_level + 6;
                                                                  ^
   ```
   



##########
be/src/vec/data_types/serde/data_type_serde.h:
##########
@@ -154,25 +156,25 @@
             // 13 (carriage return, CR, \r, ^M),
             // 27 (escape, ESC, \e [GCC only], ^[).
 
-            if (nesting_level == 1) {
+            if (hive_text_complex_type_delimiter_level == 1) {
                 ans = collection_delim;
-            } else if (nesting_level == 2) {
+            } else if (hive_text_complex_type_delimiter_level == 2) {
                 ans = map_key_delim;
-            } else if (nesting_level <= 7) {
+            } else if (hive_text_complex_type_delimiter_level <= 7) {
                 // [3, 7] -> [4, 8]
-                ans = nesting_level + 1;
-            } else if (nesting_level == 8) {
+                ans = hive_text_complex_type_delimiter_level + 1;
+            } else if (hive_text_complex_type_delimiter_level == 8) {
                 // [8] -> [11]
                 ans = 11;
-            } else if (nesting_level <= 21) {
+            } else if (hive_text_complex_type_delimiter_level <= 21) {
                 // [9, 21] -> [14, 26]
-                ans = nesting_level + 5;
-            } else if (nesting_level <= 25) {
+                ans = hive_text_complex_type_delimiter_level + 5;
+            } else if (hive_text_complex_type_delimiter_level <= 25) {
                 // [22, 25] -> [28, 31]
-                ans = nesting_level + 6;
-            } else if (nesting_level <= 153) {
+                ans = hive_text_complex_type_delimiter_level + 6;
+            } else if (hive_text_complex_type_delimiter_level <= 153) {

Review Comment:
   warning: 153 is a magic number; consider replacing it with a named constant 
[readability-magic-numbers]
   ```cpp
               } else if (hive_text_complex_type_delimiter_level <= 153) {
                                                                    ^
   ```
   



##########
be/src/vec/data_types/serde/data_type_serde.h:
##########
@@ -154,25 +156,25 @@
             // 13 (carriage return, CR, \r, ^M),
             // 27 (escape, ESC, \e [GCC only], ^[).
 
-            if (nesting_level == 1) {
+            if (hive_text_complex_type_delimiter_level == 1) {
                 ans = collection_delim;
-            } else if (nesting_level == 2) {
+            } else if (hive_text_complex_type_delimiter_level == 2) {
                 ans = map_key_delim;
-            } else if (nesting_level <= 7) {
+            } else if (hive_text_complex_type_delimiter_level <= 7) {
                 // [3, 7] -> [4, 8]
-                ans = nesting_level + 1;
-            } else if (nesting_level == 8) {
+                ans = hive_text_complex_type_delimiter_level + 1;
+            } else if (hive_text_complex_type_delimiter_level == 8) {

Review Comment:
   warning: 8 is a magic number; consider replacing it with a named constant 
[readability-magic-numbers]
   ```cpp
               } else if (hive_text_complex_type_delimiter_level == 8) {
                                                                    ^
   ```
   



##########
be/src/vec/data_types/serde/data_type_serde.h:
##########
@@ -154,25 +156,25 @@
             // 13 (carriage return, CR, \r, ^M),
             // 27 (escape, ESC, \e [GCC only], ^[).
 
-            if (nesting_level == 1) {
+            if (hive_text_complex_type_delimiter_level == 1) {
                 ans = collection_delim;
-            } else if (nesting_level == 2) {
+            } else if (hive_text_complex_type_delimiter_level == 2) {
                 ans = map_key_delim;
-            } else if (nesting_level <= 7) {
+            } else if (hive_text_complex_type_delimiter_level <= 7) {
                 // [3, 7] -> [4, 8]
-                ans = nesting_level + 1;
-            } else if (nesting_level == 8) {
+                ans = hive_text_complex_type_delimiter_level + 1;
+            } else if (hive_text_complex_type_delimiter_level == 8) {
                 // [8] -> [11]
                 ans = 11;
-            } else if (nesting_level <= 21) {
+            } else if (hive_text_complex_type_delimiter_level <= 21) {
                 // [9, 21] -> [14, 26]
-                ans = nesting_level + 5;
-            } else if (nesting_level <= 25) {
+                ans = hive_text_complex_type_delimiter_level + 5;

Review Comment:
   warning: 5 is a magic number; consider replacing it with a named constant 
[readability-magic-numbers]
   ```cpp
                   ans = hive_text_complex_type_delimiter_level + 5;
                                                                  ^
   ```
   



##########
be/src/vec/data_types/serde/data_type_serde.h:
##########
@@ -154,25 +156,25 @@
             // 13 (carriage return, CR, \r, ^M),
             // 27 (escape, ESC, \e [GCC only], ^[).
 
-            if (nesting_level == 1) {
+            if (hive_text_complex_type_delimiter_level == 1) {
                 ans = collection_delim;
-            } else if (nesting_level == 2) {
+            } else if (hive_text_complex_type_delimiter_level == 2) {
                 ans = map_key_delim;
-            } else if (nesting_level <= 7) {
+            } else if (hive_text_complex_type_delimiter_level <= 7) {
                 // [3, 7] -> [4, 8]
-                ans = nesting_level + 1;
-            } else if (nesting_level == 8) {
+                ans = hive_text_complex_type_delimiter_level + 1;
+            } else if (hive_text_complex_type_delimiter_level == 8) {
                 // [8] -> [11]
                 ans = 11;
-            } else if (nesting_level <= 21) {
+            } else if (hive_text_complex_type_delimiter_level <= 21) {
                 // [9, 21] -> [14, 26]
-                ans = nesting_level + 5;
-            } else if (nesting_level <= 25) {
+                ans = hive_text_complex_type_delimiter_level + 5;
+            } else if (hive_text_complex_type_delimiter_level <= 25) {

Review Comment:
   warning: 25 is a magic number; consider replacing it with a named constant 
[readability-magic-numbers]
   ```cpp
               } else if (hive_text_complex_type_delimiter_level <= 25) {
                                                                    ^
   ```
   



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to