public class ComparisonPredicate<C extends Comparable<C>> extends LogicalExpressionBase implements FilterPredicate<C>
LogicalExpression.De, LogicalExpression.Se| Modifier and Type | Method and Description |
|---|---|
<T,V,E extends Exception> |
accept(ExprVisitor<T,V,E> visitor,
V value) |
static <C extends Comparable<C>> |
createComparisonPredicate(String function,
LogicalExpression left,
LogicalExpression right) |
Iterator<LogicalExpression> |
iterator() |
RowsMatch |
matches(StatisticsProvider<C> evaluator)
Semantics of matches() is very similar to what is implemented in Parquet library's
org.apache.parquet.filter2.statisticslevel.StatisticsFilter and
FilterPredicate
Main difference :
1. |
getCumulativeCost, getDescription, getMajorType, getPosition, getSelfCost, iclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic Iterator<LogicalExpression> iterator()
iterator in interface Iterable<LogicalExpression>public <T,V,E extends Exception> T accept(ExprVisitor<T,V,E> visitor, V value) throws E extends Exception
accept in interface LogicalExpressionE extends Exceptionpublic RowsMatch matches(StatisticsProvider<C> evaluator)
org.apache.parquet.filter2.statisticslevel.StatisticsFilter and
FilterPredicate
Main difference :
1. A RangeExprEvaluator is used to compute the min/max of an expression, such as CAST function
of a column. CAST function could be explicitly added by Drill user (It's recommended to use CAST
function after DRILL-4372, if user wants to reduce planning time for limit 0 query), or implicitly
inserted by Drill, when the types of compare operands are not identical. Therefore, it's important
to allow CAST function to appear in the filter predicate.
2. We do not require list of ColumnChunkMetaData to do the evaluation, while Parquet library's
StatisticsFilter has such requirement. Drill's ParquetTableMetaData does not maintain ColumnChunkMetaData,
making it impossible to directly use Parquet library's StatisticFilter in query planning time.
3. We allows both sides of comparison operator to be a min/max range. As such, we support
expression_of(Column1) < expression_of(Column2),
where Column1 and Column2 are from same parquet table.matches in interface FilterPredicate<C extends Comparable<C>>public static <C extends Comparable<C>> LogicalExpression createComparisonPredicate(String function, LogicalExpression left, LogicalExpression right)
Copyright © 2022 The Apache Software Foundation. All rights reserved.