Package org.apache.iceberg.expressions
Class Expressions
- java.lang.Object
-
- org.apache.iceberg.expressions.Expressions
-
public class Expressions extends java.lang.Object
Factory methods for creatingexpressions
.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static False
alwaysFalse()
static True
alwaysTrue()
static Expression
and(Expression left, Expression right)
static Expression
and(Expression left, Expression right, Expression... expressions)
static <T> UnboundTerm<T>
bucket(java.lang.String name, int numBuckets)
static <T> UnboundAggregate<T>
count(java.lang.String name)
static <T> UnboundAggregate<T>
countStar()
static <T> UnboundTerm<T>
day(java.lang.String name)
static <T> UnboundPredicate<T>
equal(java.lang.String name, T value)
static <T> UnboundPredicate<T>
equal(UnboundTerm<T> expr, T value)
static <T> UnboundPredicate<T>
greaterThan(java.lang.String name, T value)
static <T> UnboundPredicate<T>
greaterThan(UnboundTerm<T> expr, T value)
static <T> UnboundPredicate<T>
greaterThanOrEqual(java.lang.String name, T value)
static <T> UnboundPredicate<T>
greaterThanOrEqual(UnboundTerm<T> expr, T value)
static <T> UnboundTerm<T>
hour(java.lang.String name)
static <T> UnboundPredicate<T>
in(java.lang.String name, java.lang.Iterable<T> values)
static <T> UnboundPredicate<T>
in(java.lang.String name, T... values)
static <T> UnboundPredicate<T>
in(UnboundTerm<T> expr, java.lang.Iterable<T> values)
static <T> UnboundPredicate<T>
in(UnboundTerm<T> expr, T... values)
static <T> UnboundPredicate<T>
isNaN(java.lang.String name)
static <T> UnboundPredicate<T>
isNaN(UnboundTerm<T> expr)
static <T> UnboundPredicate<T>
isNull(java.lang.String name)
static <T> UnboundPredicate<T>
isNull(UnboundTerm<T> expr)
static <T> UnboundPredicate<T>
lessThan(java.lang.String name, T value)
static <T> UnboundPredicate<T>
lessThan(UnboundTerm<T> expr, T value)
static <T> UnboundPredicate<T>
lessThanOrEqual(java.lang.String name, T value)
static <T> UnboundPredicate<T>
lessThanOrEqual(UnboundTerm<T> expr, T value)
static <T> Literal<T>
lit(T value)
Create aLiteral
from an Object.static <T> UnboundAggregate<T>
max(java.lang.String name)
static <T> UnboundAggregate<T>
min(java.lang.String name)
static <T> UnboundTerm<T>
month(java.lang.String name)
static Expression
not(Expression child)
static <T> UnboundPredicate<T>
notEqual(java.lang.String name, T value)
static <T> UnboundPredicate<T>
notEqual(UnboundTerm<T> expr, T value)
static <T> UnboundPredicate<T>
notIn(java.lang.String name, java.lang.Iterable<T> values)
static <T> UnboundPredicate<T>
notIn(java.lang.String name, T... values)
static <T> UnboundPredicate<T>
notIn(UnboundTerm<T> expr, java.lang.Iterable<T> values)
static <T> UnboundPredicate<T>
notIn(UnboundTerm<T> expr, T... values)
static <T> UnboundPredicate<T>
notNaN(java.lang.String name)
static <T> UnboundPredicate<T>
notNaN(UnboundTerm<T> expr)
static <T> UnboundPredicate<T>
notNull(java.lang.String name)
static <T> UnboundPredicate<T>
notNull(UnboundTerm<T> expr)
static UnboundPredicate<java.lang.String>
notStartsWith(java.lang.String name, java.lang.String value)
static UnboundPredicate<java.lang.String>
notStartsWith(UnboundTerm<java.lang.String> expr, java.lang.String value)
static Expression
or(Expression left, Expression right)
static <T> UnboundPredicate<T>
predicate(Expression.Operation op, java.lang.String name)
static <T> UnboundPredicate<T>
predicate(Expression.Operation op, java.lang.String name, java.lang.Iterable<T> values)
static <T> UnboundPredicate<T>
predicate(Expression.Operation op, java.lang.String name, Literal<T> lit)
static <T> UnboundPredicate<T>
predicate(Expression.Operation op, java.lang.String name, T value)
static <T> UnboundPredicate<T>
predicate(Expression.Operation op, UnboundTerm<T> expr)
static <T> UnboundPredicate<T>
predicate(Expression.Operation op, UnboundTerm<T> expr, java.lang.Iterable<T> values)
static <T> NamedReference<T>
ref(java.lang.String name)
Constructs a reference for a given column.static Expression
rewriteNot(Expression expr)
static UnboundPredicate<java.lang.String>
startsWith(java.lang.String name, java.lang.String value)
static UnboundPredicate<java.lang.String>
startsWith(UnboundTerm<java.lang.String> expr, java.lang.String value)
static <T> UnboundTerm<T>
transform(java.lang.String name, Transform<?,T> transform)
Constructs a transform expression for a given column.static <T> UnboundTerm<T>
truncate(java.lang.String name, int width)
static <T> UnboundTerm<T>
year(java.lang.String name)
-
-
-
Method Detail
-
and
public static Expression and(Expression left, Expression right)
-
and
public static Expression and(Expression left, Expression right, Expression... expressions)
-
or
public static Expression or(Expression left, Expression right)
-
not
public static Expression not(Expression child)
-
bucket
public static <T> UnboundTerm<T> bucket(java.lang.String name, int numBuckets)
-
year
public static <T> UnboundTerm<T> year(java.lang.String name)
-
month
public static <T> UnboundTerm<T> month(java.lang.String name)
-
day
public static <T> UnboundTerm<T> day(java.lang.String name)
-
hour
public static <T> UnboundTerm<T> hour(java.lang.String name)
-
truncate
public static <T> UnboundTerm<T> truncate(java.lang.String name, int width)
-
isNull
public static <T> UnboundPredicate<T> isNull(java.lang.String name)
-
isNull
public static <T> UnboundPredicate<T> isNull(UnboundTerm<T> expr)
-
notNull
public static <T> UnboundPredicate<T> notNull(java.lang.String name)
-
notNull
public static <T> UnboundPredicate<T> notNull(UnboundTerm<T> expr)
-
isNaN
public static <T> UnboundPredicate<T> isNaN(java.lang.String name)
-
isNaN
public static <T> UnboundPredicate<T> isNaN(UnboundTerm<T> expr)
-
notNaN
public static <T> UnboundPredicate<T> notNaN(java.lang.String name)
-
notNaN
public static <T> UnboundPredicate<T> notNaN(UnboundTerm<T> expr)
-
lessThan
public static <T> UnboundPredicate<T> lessThan(java.lang.String name, T value)
-
lessThan
public static <T> UnboundPredicate<T> lessThan(UnboundTerm<T> expr, T value)
-
lessThanOrEqual
public static <T> UnboundPredicate<T> lessThanOrEqual(java.lang.String name, T value)
-
lessThanOrEqual
public static <T> UnboundPredicate<T> lessThanOrEqual(UnboundTerm<T> expr, T value)
-
greaterThan
public static <T> UnboundPredicate<T> greaterThan(java.lang.String name, T value)
-
greaterThan
public static <T> UnboundPredicate<T> greaterThan(UnboundTerm<T> expr, T value)
-
greaterThanOrEqual
public static <T> UnboundPredicate<T> greaterThanOrEqual(java.lang.String name, T value)
-
greaterThanOrEqual
public static <T> UnboundPredicate<T> greaterThanOrEqual(UnboundTerm<T> expr, T value)
-
equal
public static <T> UnboundPredicate<T> equal(java.lang.String name, T value)
-
equal
public static <T> UnboundPredicate<T> equal(UnboundTerm<T> expr, T value)
-
notEqual
public static <T> UnboundPredicate<T> notEqual(java.lang.String name, T value)
-
notEqual
public static <T> UnboundPredicate<T> notEqual(UnboundTerm<T> expr, T value)
-
startsWith
public static UnboundPredicate<java.lang.String> startsWith(java.lang.String name, java.lang.String value)
-
startsWith
public static UnboundPredicate<java.lang.String> startsWith(UnboundTerm<java.lang.String> expr, java.lang.String value)
-
notStartsWith
public static UnboundPredicate<java.lang.String> notStartsWith(java.lang.String name, java.lang.String value)
-
notStartsWith
public static UnboundPredicate<java.lang.String> notStartsWith(UnboundTerm<java.lang.String> expr, java.lang.String value)
-
in
public static <T> UnboundPredicate<T> in(java.lang.String name, T... values)
-
in
public static <T> UnboundPredicate<T> in(UnboundTerm<T> expr, T... values)
-
in
public static <T> UnboundPredicate<T> in(java.lang.String name, java.lang.Iterable<T> values)
-
in
public static <T> UnboundPredicate<T> in(UnboundTerm<T> expr, java.lang.Iterable<T> values)
-
notIn
public static <T> UnboundPredicate<T> notIn(java.lang.String name, T... values)
-
notIn
public static <T> UnboundPredicate<T> notIn(UnboundTerm<T> expr, T... values)
-
notIn
public static <T> UnboundPredicate<T> notIn(java.lang.String name, java.lang.Iterable<T> values)
-
notIn
public static <T> UnboundPredicate<T> notIn(UnboundTerm<T> expr, java.lang.Iterable<T> values)
-
predicate
public static <T> UnboundPredicate<T> predicate(Expression.Operation op, java.lang.String name, T value)
-
predicate
public static <T> UnboundPredicate<T> predicate(Expression.Operation op, java.lang.String name, Literal<T> lit)
-
predicate
public static <T> UnboundPredicate<T> predicate(Expression.Operation op, java.lang.String name, java.lang.Iterable<T> values)
-
predicate
public static <T> UnboundPredicate<T> predicate(Expression.Operation op, java.lang.String name)
-
predicate
public static <T> UnboundPredicate<T> predicate(Expression.Operation op, UnboundTerm<T> expr, java.lang.Iterable<T> values)
-
predicate
public static <T> UnboundPredicate<T> predicate(Expression.Operation op, UnboundTerm<T> expr)
-
alwaysTrue
public static True alwaysTrue()
-
alwaysFalse
public static False alwaysFalse()
-
rewriteNot
public static Expression rewriteNot(Expression expr)
-
ref
public static <T> NamedReference<T> ref(java.lang.String name)
Constructs a reference for a given column.The following are equivalent: equals("a", 5) and equals(ref("a"), 5).
- Type Parameters:
T
- the Java type of this reference- Parameters:
name
- a column name- Returns:
- a named reference
-
transform
public static <T> UnboundTerm<T> transform(java.lang.String name, Transform<?,T> transform)
Constructs a transform expression for a given column.- Type Parameters:
T
- the Java type of this term- Parameters:
name
- a column nametransform
- a transform function- Returns:
- an unbound transform expression
-
lit
public static <T> Literal<T> lit(T value)
Create aLiteral
from an Object.- Type Parameters:
T
- Java type of value- Parameters:
value
- a value- Returns:
- a Literal for the given value
- Throws:
java.lang.IllegalArgumentException
- if the value has no literal implementation
-
count
public static <T> UnboundAggregate<T> count(java.lang.String name)
-
countStar
public static <T> UnboundAggregate<T> countStar()
-
max
public static <T> UnboundAggregate<T> max(java.lang.String name)
-
min
public static <T> UnboundAggregate<T> min(java.lang.String name)
-
-