Package io.delta.kernel.expressions
Class Predicate
Object
io.delta.kernel.expressions.ScalarExpression
io.delta.kernel.expressions.Predicate
- All Implemented Interfaces:
Expression
- Direct Known Subclasses:
AlwaysFalse,AlwaysTrue,And,In,Or,StGeometryBoxesIntersect
Defines predicate scalar expression which is an extension of
ScalarExpression that
evaluates to true, false, or null for each input row.
Currently, implementations of ExpressionHandler requires support for at least the
following scalar expressions.
- Name:
=- SQL semantic:
expr1 = expr2 [COLLATE collationIdentifier] - Since version: 3.0.0
- SQL semantic:
- Name:
<- SQL semantic:
expr1 < expr2 [COLLATE collationIdentifier] - Since version: 3.0.0
- SQL semantic:
- Name:
<=- SQL semantic:
expr1 <= expr2 [COLLATE collationIdentifier] - Since version: 3.0.0
- SQL semantic:
- Name:
>- SQL semantic:
expr1 > expr2 [COLLATE collationIdentifier] - Since version: 3.0.0
- SQL semantic:
- Name:
>=- SQL semantic:
expr1 >= expr2 [COLLATE collationIdentifier] - Since version: 3.0.0
- SQL semantic:
- Name:
ALWAYS_TRUE- SQL semantic:
Constant expression whose value is `true` - Since version: 3.0.0
- SQL semantic:
- Name:
ALWAYS_FALSE- SQL semantic:
Constant expression whose value is `false` - Since version: 3.0.0
- SQL semantic:
- Name:
AND- SQL semantic:
expr1 AND expr2 - Since version: 3.0.0
- SQL semantic:
- Name:
OR- SQL semantic:
expr1 OR expr2 - Since version: 3.0.0
- SQL semantic:
- Name:
NOT- SQL semantic:
NOT expr - Since version: 3.1.0
- SQL semantic:
- Name:
IS_NOT_NULL- SQL semantic:
expr IS NOT NULL - Since version: 3.1.0
- SQL semantic:
- Name:
IS_NULL- SQL semantic:
expr IS NULL - Since version: 3.2.0
- SQL semantic:
- Name:
LIKE- SQL semantic:
expr LIKE expr - Since version: 3.3.0
- SQL semantic:
- Name:
IS NOT DISTINCT FROM- SQL semantic:
expr1 IS NOT DISTINCT FROM expr2 [COLLATE collationIdentifier] - Since version: 3.3.0
- SQL semantic:
- Name:
STARTS_WITH- SQL semantic:
expr STARTS_WITH expr [COLLATE collationIdentifier] - Since version: 3.4.0
- SQL semantic:
- Name:
IN- SQL semantic:
expr IN (expr1, expr2, ...) [COLLATE collationIdentifier] - Since version: 4.0.0
- SQL semantic:
- Since:
- 3.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionPredicate(String name, Expression child) Constructor for a unary Predicate expressionPredicate(String name, Expression left, Expression right) Constructor for a binary Predicate expressionPredicate(String name, Expression left, Expression right, CollationIdentifier collationIdentifier) Constructor for a Predicate expression with collation support.Predicate(String name, List<Expression> children) Predicate(String name, List<Expression> children, CollationIdentifier collationIdentifier) Constructor for a Predicate expression with collation support. -
Method Summary
Methods inherited from class io.delta.kernel.expressions.ScalarExpression
getChildren, getName
-
Constructor Details
-
Predicate
-
Predicate
Constructor for a unary Predicate expression -
Predicate
Constructor for a binary Predicate expression -
Predicate
public Predicate(String name, Expression left, Expression right, CollationIdentifier collationIdentifier) Constructor for a Predicate expression with collation support. -
Predicate
Constructor for a Predicate expression with collation support.
-
-
Method Details
-
getCollationIdentifier
Returns the collation identifier used for this predicate, if specified. -
toString
Returns string representation of the predicate.Format for binary operators:
(left OP right)or(left OP right COLLATE collation)Examples:
(col = 5)(name = 'John' COLLATE SPARK.UTF8_BINARY)
Note: Specialized operators like IN override this method to provide their own string representation.
- Overrides:
toStringin classScalarExpression
-
hashCode
public int hashCode() -
equals
-