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

Method analyze

fe/src/main/java/org/apache/impala/analysis/Expr.java:520–552  ·  view source on GitHub ↗
(Analyzer analyzer)

Source from the content-addressed store, hash-verified

518 // expression, leaving the StmtNode version to analyze statements
519 // in-place.
520 public final void analyze(Analyzer analyzer) throws AnalysisException {
521 if (isAnalyzed()) return;
522
523 // Check the expr child limit.
524 if (children_.size() > EXPR_CHILDREN_LIMIT) {
525 String sql = toSql();
526 String sqlSubstr = sql.substring(0, Math.min(80, sql.length()));
527 throw new AnalysisException(String.format("Exceeded the maximum number of child " +
528 "expressions (%s).\nExpression has %s children:\n%s...",
529 EXPR_CHILDREN_LIMIT, children_.size(), sqlSubstr));
530 }
531
532 // analyzer may be null for certain literal constructions (e.g. IntLiteral).
533 if (analyzer != null) {
534 analyzer.incrementCallDepth();
535 // Check the expr depth limit. Do not print the toSql() to not overflow the stack.
536 if (analyzer.getCallDepth() > EXPR_DEPTH_LIMIT) {
537 throw new AnalysisException(String.format("Exceeded the maximum depth of an " +
538 "expression tree (%s).", EXPR_DEPTH_LIMIT));
539 }
540 incrementNumStmtExprs(analyzer);
541 }
542 for (Expr child: children_) {
543 child.analyze(analyzer);
544 }
545 if (analyzer != null) analyzer.decrementCallDepth();
546 computeNumDistinctValues();
547
548 // Do all the analysis for the expr subclass before marking the Expr analyzed.
549 analyzeImpl(analyzer);
550 evalCost_ = computeEvalCost();
551 analysisDone();
552 }
553
554 protected void analyzeHints(Analyzer analyzer) throws AnalysisException {
555 if (predicateHints_ != null && !predicateHints_.isEmpty()) {

Callers 15

applyRuleBottomUpMethod · 0.95
applyMethod · 0.95
applyMethod · 0.95
analyzeNoThrowMethod · 0.95
trySubstituteMethod · 0.95
optimizeConjunctsMethod · 0.95
evalToIntegerMethod · 0.95
analyzeMethod · 0.95
analyzeBoundaryValueMethod · 0.95

Calls 15

isAnalyzedMethod · 0.95
toSqlMethod · 0.95
incrementNumStmtExprsMethod · 0.95
analyzeImplMethod · 0.95
computeEvalCostMethod · 0.95
analysisDoneMethod · 0.95
minMethod · 0.80
incrementCallDepthMethod · 0.80
getCallDepthMethod · 0.80
decrementCallDepthMethod · 0.80
analyzeMethod · 0.65

Tested by

no test coverage detected