Package org.apache.iceberg.expressions
Class ResidualEvaluator
java.lang.Object
org.apache.iceberg.expressions.ResidualEvaluator
- All Implemented Interfaces:
 Serializable
Finds the residuals for an 
Expression the partitions in the given PartitionSpec.
 A residual expression is made by partially evaluating an expression using partition values. For example, if a table is partitioned by day(utc_timestamp) and is read with a filter expression utc_timestamp >= a and utc_timestamp <= b, then there are 4 possible residuals expressions for the partition data, d:
- If d > day(a) and d < day(b), the residual is always true
 - If d == day(a) and d != day(b), the residual is utc_timestamp >= a
 - if d == day(b) and d != day(a), the residual is utc_timestamp <= b
 - If d == day(a) == day(b), the residual is utc_timestamp >= a and utc_timestamp <= b
 
Partition data is passed using StructLike. Residuals are returned by residualFor(StructLike).
 
This class is thread-safe.
- See Also:
 
- 
Method Summary
Modifier and TypeMethodDescriptionstatic ResidualEvaluatorof(PartitionSpec spec, Expression expr, boolean caseSensitive) Return a residual evaluator for aspecandexpression.residualFor(StructLike partitionData) Returns a residual expression for the given partition values.static ResidualEvaluatorunpartitioned(Expression expr) Return a residual evaluator for an unpartitionedspec. 
- 
Method Details
- 
unpartitioned
Return a residual evaluator for an unpartitionedspec.- Parameters:
 expr- an expression- Returns:
 - a residual evaluator that always returns the expression
 
 - 
of
Return a residual evaluator for aspecandexpression.- Parameters:
 spec- a partition specexpr- an expression- Returns:
 - a residual evaluator for the expression
 
 - 
residualFor
Returns a residual expression for the given partition values.- Parameters:
 partitionData- partition data values- Returns:
 - the residual of this evaluator's expression from the partition values
 
 
 -