Skip to content
Merged
Show file tree
Hide file tree
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: 8 additions & 4 deletions cpp/velox/shuffle/VeloxShuffleReader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -548,14 +548,18 @@ VeloxRssSortShuffleReaderDeserializer::VeloxRssSortShuffleReaderDeserializer(
batchSize_(batchSize),
veloxCompressionType_(veloxCompressionType),
serde_(getNamedVectorSerde(facebook::velox::VectorSerde::Kind::kPresto)),
deserializeTime_(deserializeTime) {
constexpr uint64_t kMaxReadBufferSize = (1 << 20) - AlignedBuffer::kPaddedSize;
auto buffer = AlignedBuffer::allocate<char>(kMaxReadBufferSize, veloxPool_.get());
in_ = std::make_unique<VeloxInputStream>(std::move(in), std::move(buffer));
deserializeTime_(deserializeTime),
arrowIn_(in) {
serdeOptions_ = {false, veloxCompressionType_};
}

std::shared_ptr<ColumnarBatch> VeloxRssSortShuffleReaderDeserializer::next() {
if (in_ == nullptr) {
constexpr uint64_t kMaxReadBufferSize = (1 << 20) - AlignedBuffer::kPaddedSize;
auto buffer = AlignedBuffer::allocate<char>(kMaxReadBufferSize, veloxPool_.get());
in_ = std::make_unique<VeloxInputStream>(std::move(arrowIn_), std::move(buffer));
}

if (!in_->hasNext()) {
return nullptr;
}
Expand Down
1 change: 1 addition & 0 deletions cpp/velox/shuffle/VeloxShuffleReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ class VeloxRssSortShuffleReaderDeserializer : public ColumnarBatchIterator {
facebook::velox::serializer::presto::PrestoVectorSerde::PrestoOptions serdeOptions_;
int64_t& deserializeTime_;
std::shared_ptr<VeloxInputStream> in_;
std::shared_ptr<arrow::io::InputStream> arrowIn_;
};

class VeloxShuffleReaderDeserializerFactory {
Expand Down
Loading