From 54ad56dbc8ff593d8942fe527cf055d4b6a9ee40 Mon Sep 17 00:00:00 2001 From: "Huameng (Michael) Jiang" Date: Thu, 5 Dec 2024 20:15:43 -0800 Subject: [PATCH] refactor(nimble selective reader): Extract common deduplicated reader helper class (#11766) Summary: Pull Request resolved: https://github.com/facebookincubator/velox/pull/11766 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. Reviewed By: Yuhta Differential Revision: D66812388 fbshipit-source-id: 3a72dcd77acb01e9e4361f0ef9bffc90a98ce385 --- 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 {