diff --git a/presto-native-execution/presto_cpp/main/operators/tests/BroadcastTest.cpp b/presto-native-execution/presto_cpp/main/operators/tests/BroadcastTest.cpp index f9cb9d94a8bf..b87562df03ab 100644 --- a/presto-native-execution/presto_cpp/main/operators/tests/BroadcastTest.cpp +++ b/presto-native-execution/presto_cpp/main/operators/tests/BroadcastTest.cpp @@ -208,10 +208,10 @@ class BroadcastTest : public exec::test::OperatorTestBase { ranges.emplace_back(ByteRange{ const_cast(range.data()), (int32_t)range.size(), 0}); } - auto byteStream = std::make_unique(std::move(ranges)); + ByteInputStream byteStream(std::move(ranges)); RowVectorPtr result; - VectorStreamGroup::read(byteStream.get(), pool(), dataType, &result); + VectorStreamGroup::read(&byteStream, pool(), dataType, &result); return result; } }; diff --git a/presto-native-execution/presto_cpp/main/tests/PrestoExchangeSourceTest.cpp b/presto-native-execution/presto_cpp/main/tests/PrestoExchangeSourceTest.cpp index e4455b10557f..e0a490262952 100644 --- a/presto-native-execution/presto_cpp/main/tests/PrestoExchangeSourceTest.cpp +++ b/presto-native-execution/presto_cpp/main/tests/PrestoExchangeSourceTest.cpp @@ -311,9 +311,9 @@ class Producer { std::string toString(exec::SerializedPage* page) { auto input = page->prepareStreamForDeserialize(); - auto numBytes = input->read(); + auto numBytes = input.read(); char data[numBytes + 1]; - input->readBytes(data, numBytes); + input.readBytes(data, numBytes); data[numBytes] = '\0'; return std::string(data); } diff --git a/presto-native-execution/presto_cpp/main/tests/TaskManagerTest.cpp b/presto-native-execution/presto_cpp/main/tests/TaskManagerTest.cpp index c80ec9cdfb36..f662e3197da8 100644 --- a/presto-native-execution/presto_cpp/main/tests/TaskManagerTest.cpp +++ b/presto-native-execution/presto_cpp/main/tests/TaskManagerTest.cpp @@ -156,12 +156,12 @@ class Cursor { const_cast(range.data()), (int32_t)range.size(), 0}); } - auto input = std::make_unique(std::move(byteRanges)); + ByteInputStream input(std::move(byteRanges)); std::vector vectors; - while (!input->atEnd()) { + while (!input.atEnd()) { RowVectorPtr vector; - VectorStreamGroup::read(input.get(), pool_, rowType_, &vector); + VectorStreamGroup::read(&input, pool_, rowType_, &vector); vectors.emplace_back(vector); } return vectors; diff --git a/presto-native-execution/presto_cpp/presto_protocol/Base64Util.cpp b/presto-native-execution/presto_cpp/presto_protocol/Base64Util.cpp index 4dbaa20d3ec2..ddee984f44b7 100644 --- a/presto-native-execution/presto_cpp/presto_protocol/Base64Util.cpp +++ b/presto-native-execution/presto_cpp/presto_protocol/Base64Util.cpp @@ -19,12 +19,12 @@ using namespace facebook::velox; namespace facebook::presto::protocol { namespace { -std::unique_ptr toByteStream(const std::string& input) { +ByteInputStream toByteStream(const std::string& input) { ByteRange byteRange{ reinterpret_cast(const_cast(input.data())), (int32_t)input.length(), 0}; - return std::make_unique(std::vector{byteRange}); + return ByteInputStream({byteRange}); } } // namespace @@ -37,7 +37,7 @@ velox::VectorPtr readBlock( auto byteStream = toByteStream(data); VectorPtr result; serializer::presto::PrestoVectorSerde serde; - serde.deserializeSingleColumn(byteStream.get(), pool, type, &result, nullptr); + serde.deserializeSingleColumn(&byteStream, pool, type, &result, nullptr); return result; }