Package io.delta.kernel.expressions
Class In
Object
io.delta.kernel.expressions.ScalarExpression
io.delta.kernel.expressions.Predicate
io.delta.kernel.expressions.In
- All Implemented Interfaces:
Expression
IN expression
Definition:
- SQL semantic:
expr IN (expr1, expr2, ...) [COLLATE collationIdentifier] - Requires the value expression to be evaluated against a list of literal expressions.
- Result is true if the value matches any element in the list, false if no matches and no nulls, null if the value is null or any comparison results in null.
- Supports collation for string comparisons.
- Only supports primitive types . Nested types are not supported.
- Since:
- 4.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionIn(Expression valueExpression, List<Expression> inListElements) Creates an IN predicate expression.In(Expression valueExpression, List<Expression> inListElements, CollationIdentifier collationIdentifier) Creates an IN predicate expression with collation support. -
Method Summary
Methods inherited from class io.delta.kernel.expressions.Predicate
equals, getCollationIdentifier, hashCodeMethods inherited from class io.delta.kernel.expressions.ScalarExpression
getChildren, getName
-
Constructor Details
-
In
Creates an IN predicate expression.- Parameters:
valueExpression- The expression to evaluate (left side of IN)inListElements- The list of literal expressions to check against
-
In
public In(Expression valueExpression, List<Expression> inListElements, CollationIdentifier collationIdentifier) Creates an IN predicate expression with collation support.- Parameters:
valueExpression- The expression to evaluate (left side of IN)inListElements- The list of literal expressions to check againstcollationIdentifier- The collation identifier for string comparisons
-
-
Method Details
-
getValueExpression
- Returns:
- The value expression to be evaluated (left side of IN).
-
getInListElements
- Returns:
- The list of expressions to check against (right side of IN).
-
toString
Description copied from class:PredicateReturns 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.
-