Skip to content

Commit

Permalink
Optimize memory usage in buffering parquet::ReaderProperties::GetStream
Browse files Browse the repository at this point in the history
  • Loading branch information
mapleFU committed Jun 26, 2024
1 parent 508bdaa commit 93112ed
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cpp/src/parquet/properties.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ std::shared_ptr<ArrowInputStream> ReaderProperties::GetStream(
// of source
PARQUET_ASSIGN_OR_THROW(
std::shared_ptr<::arrow::io::InputStream> safe_stream,
::arrow::io::RandomAccessFile::GetStream(source, start, num_bytes));
PARQUET_ASSIGN_OR_THROW(
auto stream, ::arrow::io::BufferedInputStream::Create(buffer_size_, pool_,
safe_stream, num_bytes));
::arrow::io::RandomAccessFile::GetStream(std::move(source), start, num_bytes));
PARQUET_ASSIGN_OR_THROW(auto stream, ::arrow::io::BufferedInputStream::Create(
std::min(buffer_size_, num_bytes), pool_,
safe_stream, num_bytes));
return stream;
} else {
PARQUET_ASSIGN_OR_THROW(auto data, source->ReadAt(start, num_bytes));
Expand Down

0 comments on commit 93112ed

Please sign in to comment.