15 package com.cloudera.impala.analysis;
17 import java.util.ArrayList;
18 import java.util.List;
21 import com.cloudera.impala.thrift.TExprNode;
22 import com.google.common.base.Preconditions;
23 import com.google.common.collect.Lists;
44 boolean isNotBetween) {
45 originalChildren_.add(compareExpr);
46 originalChildren_.add(lowerBound);
47 originalChildren_.add(upperBound);
48 this.isNotBetween_ = isNotBetween;
71 super.analyze(analyzer);
73 (originalChildren_.get(1) instanceof
Subquery ||
76 "supported in a between predicate: " +
toSqlImpl());
102 rewrittenPredicate_.analyze(analyzer);
103 fn_ = rewrittenPredicate_.fn_;
106 Preconditions.checkState(
false,
"Analysis failed in rewritten between predicate");
110 children_ = rewrittenPredicate_.getChildren();
116 return rewrittenPredicate_.getConjuncts();
121 rewrittenPredicate_.toThrift(msg);
127 return originalChildren_.get(0).
toSql() +
" " + notStr +
"BETWEEN " +
128 originalChildren_.get(1).
toSql() +
" AND " + originalChildren_.get(2).
toSql();
138 Preconditions.checkNotNull(
clone);
139 clone.originalChildren_ =
CompoundPredicate getRewrittenPredicate()
BetweenPredicate(Expr compareExpr, Expr lowerBound, Expr upperBound, boolean isNotBetween)
void analyze(Analyzer analyzer)
List< Expr > getConjuncts()
BetweenPredicate(BetweenPredicate other)
CompoundPredicate rewrittenPredicate_
Expr substituteImpl(ExprSubstitutionMap smap, Analyzer analyzer)
ArrayList< Expr > originalChildren_
Expr substituteImpl(ExprSubstitutionMap smap, Analyzer analyzer)
void toThrift(TExprNode msg)
final boolean isNotBetween_
static double DEFAULT_SELECTIVITY