coderex2522 commented on code in PR #1275:
URL: https://github.com/apache/orc/pull/1275#discussion_r1004362886


##########
c++/src/BlockBuffer.cc:
##########
@@ -82,4 +83,42 @@ namespace orc {
       }
     }
   }
+
+  uint64_t BlockBuffer::writeTo(OutputStream* output) {
+    static uint64_t MAX_CHUNK_SIZE = 1024 * 1024 * 1024;
+    uint64_t chunkSize = std::min(output->getNaturalWriteSize(), 
MAX_CHUNK_SIZE);
+    if (chunkSize == 0) {
+      throw std::logic_error("Natural write size cannot be zero");
+    }
+    char* chunk = memoryPool.malloc(chunkSize);

Review Comment:
   if natural write size less than block size, here need to malloc chunk.



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

Reply via email to