Skip to content

Commit

Permalink
fix an error
Browse files Browse the repository at this point in the history
  • Loading branch information
mapleFU committed Apr 10, 2024
1 parent b22b46f commit 81fe3a3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cpp/src/arrow/io/compressed.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <algorithm>
#include <cstring>
#include <iostream>
#include <memory>
#include <mutex>
#include <string>
Expand Down Expand Up @@ -355,7 +356,10 @@ class CompressedInputStream::Impl {
// Try to feed more data into the decompressed_ buffer.
Status RefillDecompressed(bool* has_data) {
// First try to read data from the decompressor
if (CompressedBufferAvailable() != 0) {
// This doesn't use `CompressedBufferAvailable()` because when compressed_
// exists, and it doesn't contain any available data, it might trigger
// an empty decompress and set fresh_decompressor_ to true.
if (compressed_ && compressed_->size() != 0) {
if (decompressor_->IsFinished()) {
// We just went over the end of a previous compressed stream.
RETURN_NOT_OK(decompressor_->Reset());
Expand Down

0 comments on commit 81fe3a3

Please sign in to comment.