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 (#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
  • Loading branch information
Huameng (Michael) Jiang authored and facebook-github-bot committed Dec 5, 2024
1 parent 3dd572f commit 5e25f51
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 5e25f51

Please sign in to comment.