MCPcopy Create free account
hub / github.com/bytedance/bolt / getOutput

Method getOutput

bolt/exec/FilterProject.cpp:203–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203RowVectorPtr FilterProject::getOutput() {
204 if (allInputProcessed()) {
205 return nullptr;
206 }
207
208 vector_size_t size = input_->size();
209 bool isCompositeInput = RowVector::isComposite(input_);
210
211#ifdef SPARK_COMPATIBLE
212 if (skipForCompositeInput_ && isCompositeInput) {
213 BOLT_CHECK(!hasFilter_ && !isIdentityProjection_);
214 numProcessedInputRows_ = size;
215 return fillCompositeOutput(size, input_->children());
216 }
217#endif
218
219 LocalSelectivityVector localRows(*operatorCtx_->execCtx(), size);
220 auto* rows = localRows.get();
221 BOLT_DCHECK_NOT_NULL(rows)
222 rows->setAll();
223 EvalCtx evalCtx(
224 operatorCtx_->execCtx(),
225 exprs_.get(),
226 input_.get(),
227 driverCtx_->currentSplitStr,
228 acceptCompositeInput_);
229
230 // Pre-load lazy vectors which are referenced by both expressions and identity
231 // projections.
232 for (auto fieldIdx : multiplyReferencedFieldIndices_) {
233 evalCtx.ensureFieldLoaded(fieldIdx, *rows);
234 }
235
236 if (!hasFilter_) {
237 numProcessedInputRows_ = size;
238 BOLT_CHECK(!isIdentityProjection_);
239 auto results = project(*rows, evalCtx);
240 if (isCompositeInput) {
241 return fillCompositeOutput(size, results);
242 } else {
243 return fillOutput(size, nullptr, results);
244 }
245 }
246 BOLT_CHECK(!isCompositeInput);
247
248 // evaluate filter
249 auto numOut = filter(evalCtx, *rows);
250 numProcessedInputRows_ = size;
251 if (numOut == 0) { // no rows passed the filer
252 input_ = nullptr;
253 return nullptr;
254 }
255
256 bool allRowsSelected = (numOut == size);
257
258 // evaluate projections (if present)
259 std::vector<VectorPtr> results;
260 if (!isIdentityProjection_) {

Callers

nothing calls this directly

Calls 8

filterFunction · 0.85
setAllMethod · 0.80
ensureFieldLoadedMethod · 0.80
setFromBitsMethod · 0.80
sizeMethod · 0.45
childrenMethod · 0.45
execCtxMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected