From 5e25f5109835f637398bf1a4c3f669b8260cd80a Mon Sep 17 00:00:00 2001 From: "Huameng (Michael) Jiang" Date: Thu, 5 Dec 2024 13:37:32 -0800 Subject: [PATCH] refactor(nimble selective reader): Extract common deduplicated reader helper class (#11766) Summary: Extract deduplicated reader helper class to share common logic between DeduplicatedArrayColumnReader and DeduplicatedMapColumnReader. This class essentially wants to be a DeduplicatedColumnReaderBase, that inherits velox::common::SelectiveRepeatedColumnReader. This pattern is adopted because we can't both inherit from DeduplicatedColumnReaderBase and the specific column readers, without forcing virtual inheritance, or duplicating all other methods from the specific parent classes. Differential Revision: D66812388 --- velox/dwio/common/SelectiveRepeatedColumnReader.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/velox/dwio/common/SelectiveRepeatedColumnReader.h b/velox/dwio/common/SelectiveRepeatedColumnReader.h index febc4e83e67f..73be1155567e 100644 --- a/velox/dwio/common/SelectiveRepeatedColumnReader.h +++ b/velox/dwio/common/SelectiveRepeatedColumnReader.h @@ -18,6 +18,10 @@ #include "velox/dwio/common/SelectiveColumnReader.h" +namespace facebook::nimble { +class DeduplicatedReadHelper; +} + namespace facebook::velox::dwio::common { // Abstract superclass for list and map readers. Encapsulates common @@ -80,6 +84,8 @@ class SelectiveRepeatedColumnReader : public SelectiveColumnReader { // corresponding to the last non-null parent. int64_t childTargetReadOffset_ = 0; std::vector children_; + + friend class facebook::nimble::DeduplicatedReadHelper; }; class SelectiveListColumnReader : public SelectiveRepeatedColumnReader {