lidavidm commented on code in PR #15194:
URL: https://github.com/apache/arrow/pull/15194#discussion_r1118885808
##########
cpp/src/arrow/ipc/options.h:
##########
@@ -67,6 +68,21 @@ struct ARROW_EXPORT IpcWriteOptions {
/// May only be UNCOMPRESSED, LZ4_FRAME and ZSTD.
std::shared_ptr<util::Codec> codec;
+ /// @brief Minimum space savings percentage required for compression to be
applied
Review Comment:
nit: Arrow mostly uses `\brief` not Javadoc-style `@brief`
```suggestion
/// \brief Minimum space savings percentage required for compression to be
applied
```
##########
cpp/src/arrow/ipc/read_write_test.cc:
##########
@@ -735,6 +737,69 @@ TEST_F(TestWriteRecordBatch, WriteWithCompression) {
}
}
+TEST_F(TestWriteRecordBatch, WriteWithCompressionAndMinSavings) {
+ // A small batch that's known to be compressible
+ auto batch = RecordBatchFromJSON(schema({field("n", int64())}), R"([
+ {"n":0},{"n":1},{"n":2},{"n":3},{"n":4},
+ {"n":5},{"n":6},{"n":7},{"n":8},{"n":9}])");
+
+ auto prefixed_size = [](const Buffer& buffer) -> int64_t {
+ if (buffer.size() < int64_t(sizeof(int64_t))) return 0;
+ return
bit_util::FromLittleEndian(util::SafeLoadAs<int64_t>(buffer.data()));
+ };
+ auto content_size = [](const Buffer& buffer) -> int64_t {
+ return buffer.size() - sizeof(int64_t);
Review Comment:
nit: should this have a check like prefixed_size?
--
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]