-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ARROW-8218: [C++] Decompress record batch messages in parallel at field level. Only allow LZ4_FRAME, ZSTD compression #6777
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments. Also, I suppose you'll tackle the compression path at some point too?
I addressed the comments and also parallelized the compression path. Would someone take another look at these new changes? |
if (options_.use_threads) { | ||
return ::arrow::internal::ParallelFor(static_cast<int>(out_->body_buffers.size()), | ||
CompressOne); | ||
} else { | ||
for (size_t i = 0; i < out_->body_buffers.size(); ++i) { | ||
RETURN_NOT_OK(CompressOne(i)); | ||
} | ||
return Status::OK(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This "optional parallelism" pattern occurs frequently, I'll open a JIRA about factoring it out into a helper function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one style question
cpp/src/arrow/ipc/reader.cc
Outdated
Status DecompressBuffers(const std::vector<std::shared_ptr<ArrayData>>& fields, | ||
Compression::type compression, const IpcReadOptions& options) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since you're mutating the contents of fields, should this be
Status DecompressBuffers(const std::vector<std::shared_ptr<ArrayData>>& fields, | |
Compression::type compression, const IpcReadOptions& options) { | |
Status DecompressBuffers(Compression::type compression, const IpcReadOptions& options, | |
std::vector<std::shared_ptr<ArrayData>>* fields) { |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sort of a weird case not often seen, since the vector itself is not mutated. When I see std::vector<T>*
in a function signature that suggests that the vector is modified. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's true; the vector itself isn't mutated and const correctness isn't broken here. I was only thinking of trying to communicate mutation to a future reader. Unfortunately all we have is the ampersand and comments, neither of which is ideal here (... unless we start tossing std::vector<const T>
around everywhere we want to be clear that the elements are immutable)
Flaky Thrift download again
|
Googletest download flaked in Appveyor:
It passed on my fork though. +1. Merging this |
…eather V2 This PR always puts the compressed size in little-endian format for Feather V2 since the reader expected the little-endian format. Based on [the discussion](#6777 (comment)) at #6777, [this commit](aa28280) reads compressed_length in Feather V2 format as little-endian. However, the writer [puts compressed_length in native-endian](https://github.com/apache/arrow/blob/master/cpp/src/arrow/ipc/writer.cc#L177). This PR can fix failures related to reading compressed feather format in `arrow-ipc-read-write-test` and `arrow-feather-test`. Closes #7137 from kiszk/ARROW-8747 Authored-by: Kazuaki Ishizaki <ishizaki@jp.ibm.com> Signed-off-by: Wes McKinney <wesm+git@apache.org>
This PR writes and reads Plasma header (version, type, and length) in the big-endian format. It allows us to make it easy to interpret a header of Plasma data among different endian machines. The current issue is to write Plasma header in native endian at [here](https://github.com/apache/arrow/blob/master/cpp/src/plasma/io.cc#L65-L71). It is not possible to know version, type, and length of a given Plasma file among different platforms. Feather V2 also uses little-endian for the header based on [the discussion](#6777 (comment)). This PR uses little-endian by following this discussion. Closes #7146 from kiszk/ARROW-8757 Authored-by: Kazuaki Ishizaki <ishizaki@jp.ibm.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
I also changed the metadata key to "ARROW:experimental_compression", if anyone has opinions.
Haven't run benchmarks but will do so tomorrow.