(Analyzer analyzer)
| 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()) { |
no test coverage detected