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


##########
be/src/vec/core/block.cpp:
##########
@@ -875,26 +889,33 @@
         pblock->set_compression_type(compression_type);
         pblock->set_uncompressed_size(content_uncompressed_size);
 
-        BlockCompressionCodec* codec;
-        RETURN_IF_ERROR(get_block_compression_codec(compression_type, &codec));
+        faststring compress_str;
+        faststring* buf_compressed = nullptr;
+        if (ser_reuse_mem) {
+            buf_compressed = &ser_reuse_mem->compress_mem;
+        } else {
+            buf_compressed = &compress_str;
+        }
+        if (!codec) 
RETURN_IF_ERROR(get_block_compression_codec(compression_type, &codec));

Review Comment:
   warning: statement should be inside braces 
[readability-braces-around-statements]
   
   ```suggestion
           if (!codec) { 
RETURN_IF_ERROR(get_block_compression_codec(compression_type, &codec));
   }
   ```
   



##########
be/src/vec/core/block.cpp:
##########
@@ -834,10 +834,10 @@
     return filter_block(block, columns_to_filter, filter_column_id, 
column_to_keep);
 }
 
-Status Block::serialize(int be_exec_version, PBlock* pblock,
-                        /*std::string* compressed_buffer,*/ size_t* 
uncompressed_bytes,
+Status Block::serialize(int be_exec_version, PBlock* pblock, size_t* 
uncompressed_bytes,

Review Comment:
   warning: function 'serialize' exceeds recommended size/complexity thresholds 
[readability-function-size]
   ```cpp
   Status Block::serialize(int be_exec_version, PBlock* pblock, size_t* 
uncompressed_bytes,
                 ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/vec/core/block.cpp:836:** 86 lines including whitespace and 
comments (threshold 80)
   ```cpp
   Status Block::serialize(int be_exec_version, PBlock* pblock, size_t* 
uncompressed_bytes,
                 ^
   ```
   
   </details>
   



##########
be/src/vec/core/block.cpp:
##########
@@ -834,10 +834,10 @@ Status Block::filter_block(Block* block, int 
filter_column_id, int column_to_kee
     return filter_block(block, columns_to_filter, filter_column_id, 
column_to_keep);
 }
 
-Status Block::serialize(int be_exec_version, PBlock* pblock,
-                        /*std::string* compressed_buffer,*/ size_t* 
uncompressed_bytes,
+Status Block::serialize(int be_exec_version, PBlock* pblock, size_t* 
uncompressed_bytes,

Review Comment:
   warning: method 'serialize' can be made static 
[readability-convert-member-functions-to-static]
   
   be/src/vec/core/block.h:288:
   ```diff
   -     Status serialize(int be_exec_version, PBlock* pblock, size_t* 
uncompressed_bytes,
   +     static Status serialize(int be_exec_version, PBlock* pblock, size_t* 
uncompressed_bytes,
   ```
   
   be/src/vec/core/block.h:291:
   ```diff
   -                      BlockCompressionCodec* bcc = nullptr) const;
   +                      BlockCompressionCodec* bcc = nullptr) ;
   ```
   
   be/src/vec/core/block.cpp:839:
   ```diff
   -                         BlockCompressionCodec* codec) const {
   +                         BlockCompressionCodec* codec) {
   ```
   



-- 
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