diff --git a/velox/exec/FilterProject.cpp b/velox/exec/FilterProject.cpp index a4311b24f0cd..43d15d343f21 100644 --- a/velox/exec/FilterProject.cpp +++ b/velox/exec/FilterProject.cpp @@ -56,12 +56,8 @@ FilterProject::FilterProject( project_(project), filter_(filter) {} -void FilterProject::ensureInitialized() { - if (initialized_) { - VELOX_CHECK_NULL(filter_); - VELOX_CHECK_NULL(project_); - return; - } +void FilterProject::initialize() { + Operator::initialize(); std::vector allExprs; if (hasFilter_) { VELOX_CHECK_NOT_NULL(filter_); @@ -102,13 +98,11 @@ void FilterProject::ensureInitialized() { } } } - initialized_ = true; filter_.reset(); project_.reset(); } void FilterProject::addInput(RowVectorPtr input) { - ensureInitialized(); input_ = std::move(input); numProcessedInputRows_ = 0; if (!resultProjections_.empty()) { @@ -139,7 +133,6 @@ bool FilterProject::isFinished() { } RowVectorPtr FilterProject::getOutput() { - ensureInitialized(); if (allInputProcessed()) { return nullptr; } diff --git a/velox/exec/FilterProject.h b/velox/exec/FilterProject.h index 03e749a4bef6..e4eaf396af5f 100644 --- a/velox/exec/FilterProject.h +++ b/velox/exec/FilterProject.h @@ -71,7 +71,7 @@ class FilterProject : public Operator { return Export{exprs_.get(), hasFilter_, &resultProjections_}; } - void ensureInitialized(); + void initialize() override; private: // Tests if 'numProcessedRows_' equals to the length of input_ and clears diff --git a/velox/experimental/wave/exec/ToWave.cpp b/velox/experimental/wave/exec/ToWave.cpp index f9b9cae638e7..ddccfb3b5868 100644 --- a/velox/experimental/wave/exec/ToWave.cpp +++ b/velox/experimental/wave/exec/ToWave.cpp @@ -355,10 +355,6 @@ bool CompileState::compile() { // them during the transformation. driver_.initializeOperators(); for (; operatorIndex < operators.size(); ++operatorIndex) { - if (auto filterProject = dynamic_cast( - operators[operatorIndex])) { - filterProject->ensureInitialized(); - } if (!addOperator(operators[operatorIndex], nodeIndex, outputType)) { break; }