diff --git a/velox/dwio/dwrf/reader/ReaderBase.h b/velox/dwio/dwrf/reader/ReaderBase.h index a831adab27f3d..8e5b3387f37ee 100644 --- a/velox/dwio/dwrf/reader/ReaderBase.h +++ b/velox/dwio/dwrf/reader/ReaderBase.h @@ -67,13 +67,13 @@ class ReaderBase { /// Creates reader base from metadata. ReaderBase( - const dwio::common::ReaderOptions& options, + memory::MemoryPool& pool, std::unique_ptr input, std::unique_ptr ps, const proto::Footer* footer, std::unique_ptr cache, std::unique_ptr handler = nullptr) - : options_{options}, + : options_{dwio::common::ReaderOptions(&pool)}, postScript_{std::move(ps)}, footer_{std::make_unique(footer)}, cache_{std::move(cache)}, diff --git a/velox/dwio/dwrf/test/ReaderBaseTests.cpp b/velox/dwio/dwrf/test/ReaderBaseTests.cpp index 480573292afab..07b9128e1f889 100644 --- a/velox/dwio/dwrf/test/ReaderBaseTests.cpp +++ b/velox/dwio/dwrf/test/ReaderBaseTests.cpp @@ -103,9 +103,8 @@ class EncryptedStatsTest : public Test { auto readFile = std::make_shared(std::string()); readerPool_ = pool_->addLeafChild("reader"); - facebook::velox::dwio::common::ReaderOptions readerOpts{readerPool_.get()}; reader_ = std::make_unique( - readerOpts, + *readerPool_, std::make_unique(readFile, *readerPool_), std::make_unique(std::move(ps)), footer, diff --git a/velox/dwio/dwrf/test/StripeReaderBaseTests.cpp b/velox/dwio/dwrf/test/StripeReaderBaseTests.cpp index 242edb2448eb5..ff67e9f20ea88 100644 --- a/velox/dwio/dwrf/test/StripeReaderBaseTests.cpp +++ b/velox/dwio/dwrf/test/StripeReaderBaseTests.cpp @@ -65,9 +65,8 @@ class StripeLoadKeysTest : public Test { auto handler = DecryptionHandler::create(FooterWrapper(footer_.get()), &factory); pool_ = memoryManager()->addLeafPool(); - dwio::common::ReaderOptions readerOpts{pool_.get()}; reader_ = std::make_unique( - readerOpts, + *pool_, std::make_unique( std::make_shared(std::string()), *pool_), nullptr, diff --git a/velox/dwio/dwrf/test/TestStripeStream.cpp b/velox/dwio/dwrf/test/TestStripeStream.cpp index fa46be53ab9d8..b456b7c30af8c 100644 --- a/velox/dwio/dwrf/test/TestStripeStream.cpp +++ b/velox/dwio/dwrf/test/TestStripeStream.cpp @@ -128,9 +128,8 @@ TEST_F(StripeStreamTest, planReads) { ProtoUtils::writeType(*type, *footer); auto is = std::make_unique(); auto isPtr = is.get(); - facebook::velox::dwio::common::ReaderOptions readerOpts{pool_.get()}; auto readerBase = std::make_shared( - readerOpts, + *pool_, std::make_unique( std::move(is), *pool_, @@ -188,9 +187,8 @@ TEST_F(StripeStreamTest, filterSequences) { ProtoUtils::writeType(*type, *footer); auto is = std::make_unique(); auto isPtr = is.get(); - facebook::velox::dwio::common::ReaderOptions readerOpts{pool_.get()}; auto readerBase = std::make_shared( - readerOpts, + *pool_, std::make_unique(std::move(is), *pool_), std::make_unique(proto::PostScript{}), footer, @@ -256,9 +254,8 @@ TEST_F(StripeStreamTest, zeroLength) { ps.set_compression(proto::CompressionKind::ZSTD); auto is = std::make_unique(); auto isPtr = is.get(); - facebook::velox::dwio::common::ReaderOptions readerOpts{pool_.get()}; auto readerBase = std::make_shared( - readerOpts, + *pool_, std::make_unique(std::move(is), *pool_), std::make_unique(std::move(ps)), footer, @@ -349,9 +346,8 @@ TEST_F(StripeStreamTest, planReadsIndex) { auto is = std::make_unique(); auto isPtr = is.get(); - facebook::velox::dwio::common::ReaderOptions readerOpts{pool_.get()}; auto readerBase = std::make_shared( - readerOpts, + *pool_, std::make_unique(std::move(is), *pool_), std::make_unique(std::move(ps)), footer, @@ -481,9 +477,8 @@ TEST_F(StripeStreamTest, readEncryptedStreams) { *stripeFooter->add_encryptiongroups() = ""; auto readerPool = pool->addLeafChild("reader"); - facebook::velox::dwio::common::ReaderOptions readerOpts{pool_.get()}; auto readerBase = std::make_shared( - readerOpts, + *readerPool, std::make_unique( std::make_shared(std::string()), *readerPool), @@ -564,10 +559,9 @@ TEST_F(StripeStreamTest, schemaMismatch) { encrypter.setKey("key"); pw.writeProto(*stripeFooter->add_encryptiongroups(), group, encrypter); - facebook::velox::dwio::common::ReaderOptions readerOpts{pool_.get()}; auto readerPool = pool->addLeafChild("reader"); auto readerBase = std::make_shared( - readerOpts, + *readerPool, std::make_unique( std::make_shared(std::string()), *pool_),