Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cpp/src/parquet/decoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,9 @@ struct ArrowBinaryHelper<ByteArrayType, ::arrow::BinaryType> {
DCHECK_GT(entries_remaining_, 0);

if (ARROW_PREDICT_FALSE(!CanFit(length))) {
// This element would exceed the capacity of a chunk
RETURN_NOT_OK(PushChunk());
// Reserve entries and data in new chunk
RETURN_NOT_OK(ReserveInitialChunkData(estimated_remaining_data_length));
// NOTE: Keep chunk rollover out of line so AppendValue can inline into the decode
// loop.
RETURN_NOT_OK(StartNewChunk(estimated_remaining_data_length));
}
chunk_space_remaining_ -= length;
--entries_remaining_;
Expand All @@ -136,11 +135,12 @@ struct ArrowBinaryHelper<ByteArrayType, ::arrow::BinaryType> {
}

private:
Status PushChunk() {
ARROW_NOINLINE Status
StartNewChunk(std::optional<int64_t> estimated_remaining_data_length) {
ARROW_ASSIGN_OR_RAISE(auto chunk, acc_->builder->Finish());
acc_->chunks.push_back(std::move(chunk));
chunk_space_remaining_ = ::arrow::kBinaryMemoryLimit;
return Status::OK();
return ReserveInitialChunkData(estimated_remaining_data_length);
}

Status ReserveInitialChunkData(std::optional<int64_t> estimated_remaining_data_length) {
Expand Down
Loading