mapleFU commented on code in PR #38272:
URL: https://github.com/apache/arrow/pull/38272#discussion_r1398403487


##########
cpp/src/arrow/util/compression_test.cc:
##########
@@ -368,6 +368,42 @@ TEST_P(CodecTest, CodecRoundtrip) {
   }
 }
 
+TEST(CodecTest, CodecRoundtripGzipMembers) {
+  std::unique_ptr<Codec> gzip_codec;
+  ASSERT_OK_AND_ASSIGN(gzip_codec, Codec::Create(Compression::GZIP));
+
+  for (int data_half_size : {0, 10000, 100000}) {
+    int64_t actual_size_p1, actual_size_p2;
+    std::vector<uint8_t> data_half = MakeRandomData(data_half_size);
+    std::vector<uint8_t> data_full(data_half.begin(), data_half.end());
+    data_full.insert(data_full.end(), data_half.begin(), data_half.end());
+
+    int max_compressed_len_half =
+        static_cast<int>(gzip_codec->MaxCompressedLen(data_half.size(), 
data_half.data()));
+    std::vector<uint8_t> compressed(max_compressed_len_half * 2);
+
+    // Compress in 2 steps
+    ASSERT_OK_AND_ASSIGN(actual_size_p1,
+                         gzip_codec->Compress(data_half.size(), 
data_half.data(),
+                                              max_compressed_len_half, 
compressed.data()));
+    ASSERT_OK_AND_ASSIGN(

Review Comment:
   Hmmm Personally I think just 3 or 4 is ok. Just make sure this will have the 
right state for multiple groups, but 2 is also ok for me after go through the 
code.



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