Skip to content

Commit

Permalink
Clean up copy constructor of ScanSpec (facebookincubator#9520)
Browse files Browse the repository at this point in the history
Summary:

We no longer need to copy and mutate the object, remove the constructor
to make the code cleaner.

Differential Revision: D56267593
  • Loading branch information
Yuhta authored and facebook-github-bot committed Apr 17, 2024
1 parent a830ffb commit 9bcda7f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 31 deletions.
24 changes: 0 additions & 24 deletions velox/dwio/common/ScanSpec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,6 @@

namespace facebook::velox::common {

ScanSpec& ScanSpec::operator=(const ScanSpec& other) {
if (this != &other) {
numReads_ = other.numReads_;
subscript_ = other.subscript_;
fieldName_ = other.fieldName_;
channel_ = other.channel_;
constantValue_ = other.constantValue_;
projectOut_ = other.projectOut_;
extractValues_ = other.extractValues_;
makeFlat_ = other.makeFlat_;
filter_ = other.filter_;
metadataFilters_ = other.metadataFilters_;
selectivity_ = other.selectivity_;
enableFilterReorder_ = other.enableFilterReorder_;
children_ = other.children_;
stableChildren_ = other.stableChildren_;
childByFieldName_ = other.childByFieldName_;
valueHook_ = other.valueHook_;
isArrayElementOrMapEntry_ = other.isArrayElementOrMapEntry_;
maxArrayElementsCount_ = other.maxArrayElementsCount_;
}
return *this;
}

ScanSpec* ScanSpec::getOrCreateChild(const Subfield& subfield) {
auto container = this;
auto& path = subfield.path();
Expand Down
8 changes: 1 addition & 7 deletions velox/dwio/common/ScanSpec.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ class ScanSpec {

explicit ScanSpec(const std::string& name) : fieldName_(name) {}

ScanSpec(const ScanSpec& other) {
*this = other;
}

ScanSpec& operator=(const ScanSpec&);

// Filter to apply. If 'this' corresponds to a struct/list/map, this
// can only be isNull or isNotNull, other filtering is given by
// 'children'.
Expand Down Expand Up @@ -358,7 +352,7 @@ class ScanSpec {
// True if a string dictionary or flat map in this field should be
// returned as flat.
bool makeFlat_ = false;
std::shared_ptr<common::Filter> filter_;
std::unique_ptr<common::Filter> filter_;

// Filters that will be only used for row group filtering based on metadata.
// The conjunctions among these filters are tracked in MetadataFilter, with
Expand Down

0 comments on commit 9bcda7f

Please sign in to comment.