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


##########
be/src/http/action/stream_load.cpp:
##########
@@ -369,9 +375,17 @@ Status StreamLoadAction::_process_put(HttpRequest* 
http_req,
     request.__set_header_type(ctx->header_type);
     request.__set_loadId(ctx->id.to_thrift());
     if (ctx->use_streaming) {
-        auto pipe = std::make_shared<io::StreamLoadPipe>(
-                io::kMaxPipeBufferedBytes /* max_buffered_bytes */, 64 * 1024 
/* min_chunk_size */,
-                ctx->body_bytes /* total_length */);
+        std::shared_ptr<io::StreamLoadPipe> pipe;
+        LOG(INFO) << "test 111" << ctx->receive_bytes;
+        if (ctx->is_chunked_transfer) {
+            pipe = std::make_shared<io::StreamLoadPipe>(
+                    io::kMaxPipeBufferedBytes /* max_buffered_bytes */,
+                    64 * 1024 /* min_chunk_size */, -1 /* total_length */);

Review Comment:
   warning: 64 is a magic number; consider replacing it with a named constant 
[readability-magic-numbers]
   ```cpp
                       64 * 1024 /* min_chunk_size */, -1 /* total_length */);
                       ^
   ```
   



##########
be/src/http/action/stream_load.cpp:
##########
@@ -369,9 +375,17 @@
     request.__set_header_type(ctx->header_type);
     request.__set_loadId(ctx->id.to_thrift());
     if (ctx->use_streaming) {
-        auto pipe = std::make_shared<io::StreamLoadPipe>(
-                io::kMaxPipeBufferedBytes /* max_buffered_bytes */, 64 * 1024 
/* min_chunk_size */,
-                ctx->body_bytes /* total_length */);
+        std::shared_ptr<io::StreamLoadPipe> pipe;
+        LOG(INFO) << "test 111" << ctx->receive_bytes;
+        if (ctx->is_chunked_transfer) {
+            pipe = std::make_shared<io::StreamLoadPipe>(
+                    io::kMaxPipeBufferedBytes /* max_buffered_bytes */,
+                    64 * 1024 /* min_chunk_size */, -1 /* total_length */);
+        } else {
+            pipe = std::make_shared<io::StreamLoadPipe>(
+                    io::kMaxPipeBufferedBytes /* max_buffered_bytes */,
+                    64 * 1024 /* min_chunk_size */, ctx->body_bytes /* 
total_length */);

Review Comment:
   warning: 64 is a magic number; consider replacing it with a named constant 
[readability-magic-numbers]
   ```cpp
                       64 * 1024 /* min_chunk_size */, ctx->body_bytes /* 
total_length */);
                       ^
   ```
   



##########
be/src/http/action/stream_load.cpp:
##########
@@ -369,9 +375,17 @@
     request.__set_header_type(ctx->header_type);
     request.__set_loadId(ctx->id.to_thrift());
     if (ctx->use_streaming) {
-        auto pipe = std::make_shared<io::StreamLoadPipe>(
-                io::kMaxPipeBufferedBytes /* max_buffered_bytes */, 64 * 1024 
/* min_chunk_size */,
-                ctx->body_bytes /* total_length */);
+        std::shared_ptr<io::StreamLoadPipe> pipe;
+        LOG(INFO) << "test 111" << ctx->receive_bytes;
+        if (ctx->is_chunked_transfer) {
+            pipe = std::make_shared<io::StreamLoadPipe>(
+                    io::kMaxPipeBufferedBytes /* max_buffered_bytes */,
+                    64 * 1024 /* min_chunk_size */, -1 /* total_length */);

Review Comment:
   warning: 1024 is a magic number; consider replacing it with a named constant 
[readability-magic-numbers]
   ```cpp
                       64 * 1024 /* min_chunk_size */, -1 /* total_length */);
                            ^
   ```
   



##########
be/src/http/action/stream_load.cpp:
##########
@@ -369,9 +375,17 @@
     request.__set_header_type(ctx->header_type);
     request.__set_loadId(ctx->id.to_thrift());
     if (ctx->use_streaming) {
-        auto pipe = std::make_shared<io::StreamLoadPipe>(
-                io::kMaxPipeBufferedBytes /* max_buffered_bytes */, 64 * 1024 
/* min_chunk_size */,
-                ctx->body_bytes /* total_length */);
+        std::shared_ptr<io::StreamLoadPipe> pipe;
+        LOG(INFO) << "test 111" << ctx->receive_bytes;
+        if (ctx->is_chunked_transfer) {
+            pipe = std::make_shared<io::StreamLoadPipe>(
+                    io::kMaxPipeBufferedBytes /* max_buffered_bytes */,
+                    64 * 1024 /* min_chunk_size */, -1 /* total_length */);
+        } else {
+            pipe = std::make_shared<io::StreamLoadPipe>(
+                    io::kMaxPipeBufferedBytes /* max_buffered_bytes */,
+                    64 * 1024 /* min_chunk_size */, ctx->body_bytes /* 
total_length */);

Review Comment:
   warning: 1024 is a magic number; consider replacing it with a named constant 
[readability-magic-numbers]
   ```cpp
                       64 * 1024 /* min_chunk_size */, ctx->body_bytes /* 
total_length */);
                            ^
   ```
   



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