Skip to content

Commit

Permalink
refactor(nimble selective reader): Extract common deduplicated reader…
Browse files Browse the repository at this point in the history
… helper class (facebookincubator#11766)

Summary:
Pull Request resolved: facebookincubator#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
  • Loading branch information
Huameng (Michael) Jiang authored and facebook-github-bot committed Dec 6, 2024
1 parent 19533e4 commit 54ad56d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions velox/dwio/common/SelectiveRepeatedColumnReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -80,6 +84,8 @@ class SelectiveRepeatedColumnReader : public SelectiveColumnReader {
// corresponding to the last non-null parent.
int64_t childTargetReadOffset_ = 0;
std::vector<SelectiveColumnReader*> children_;

friend class facebook::nimble::DeduplicatedReadHelper;
};

class SelectiveListColumnReader : public SelectiveRepeatedColumnReader {
Expand Down

0 comments on commit 54ad56d

Please sign in to comment.