MCPcopy Create free account
hub / github.com/apache/impala / init

Method init

fe/src/main/java/org/apache/impala/planner/UnionNode.java:312–351  ·  view source on GitHub ↗

Must be called after addChild()/addConstExprList(). Computes the materialized result/const expr lists based on the materialized slots of this UnionNode's produced tuple. The UnionNode doesn't need an smap: like a ScanNode, it materializes an original tuple. There is no need to call assignConjuncts()

(Analyzer analyzer)

Source from the content-addressed store, hash-verified

310 * been evaluated during registration to set analyzer.hasEmptyResultSet_.
311 */
312 @Override
313 public void init(Analyzer analyzer) {
314 Preconditions.checkState(conjuncts_.isEmpty());
315 computeMemLayout(analyzer);
316 computeStats(analyzer);
317 computePassthrough(analyzer);
318
319 // drop resultExprs/constExprs that aren't getting materialized (= where the
320 // corresponding output slot isn't being materialized)
321 materializedResultExprLists_.clear();
322 Preconditions.checkState(resultExprLists_.size() == children_.size());
323 List<SlotDescriptor> slots = analyzer.getDescTbl().getTupleDesc(tupleId_).getSlots();
324 for (int i = 0; i < resultExprLists_.size(); ++i) {
325 List<Expr> exprList = resultExprLists_.get(i);
326 List<Expr> newExprList = new ArrayList<>();
327 Preconditions.checkState(exprList.size() == slots.size());
328 for (int j = 0; j < exprList.size(); ++j) {
329 if (slots.get(j).isMaterialized()) newExprList.add(exprList.get(j));
330 }
331 materializedResultExprLists_.add(
332 Expr.substituteList(newExprList, getChild(i).getOutputSmap(), analyzer, true));
333 }
334 Preconditions.checkState(
335 materializedResultExprLists_.size() == getChildren().size());
336
337 materializedConstExprLists_.clear();
338 for (List<Expr> exprList: constExprLists_) {
339 Preconditions.checkState(exprList.size() == slots.size());
340 List<Expr> newExprList = new ArrayList<>();
341 for (int i = 0; i < exprList.size(); ++i) {
342 if (slots.get(i).isMaterialized()) {
343 Expr constExpr = exprList.get(i);
344 // Disable codegen for const expressions which will only ever be evaluated once.
345 if (!isInSubplan_) constExpr.disableCodegen();
346 newExprList.add(constExpr);
347 }
348 }
349 materializedConstExprLists_.add(newExprList);
350 }
351 }
352
353 @Override
354 protected void toThrift(TPlanNode msg) {

Callers 5

createInlineViewPlanMethod · 0.95
createUnionPlanMethod · 0.95

Calls 15

computeStatsMethod · 0.95
computePassthroughMethod · 0.95
substituteListMethod · 0.95
disableCodegenMethod · 0.95
getSlotsMethod · 0.80
getDescTblMethod · 0.80
getChildMethod · 0.80
getChildrenMethod · 0.80
clearMethod · 0.65
getMethod · 0.65
isEmptyMethod · 0.45
computeMemLayoutMethod · 0.45

Tested by

no test coverage detected