Object
org.apache.spark.sql.internal.connector.ExpressionWithToString
org.apache.spark.sql.connector.expressions.GeneralScalarExpression
org.apache.spark.sql.connector.expressions.filter.Predicate
All Implemented Interfaces:
Serializable, Expression, scala.Serializable
Direct Known Subclasses:
AlwaysFalse, AlwaysTrue, And, Not, Or

@Evolving public class Predicate extends GeneralScalarExpression
The general representation of predicate expressions, which contains the upper-cased expression name and all the children expressions. You can also use these concrete subclasses for better type safety: And, Or, Not, AlwaysTrue, AlwaysFalse.

The currently supported predicate expressions:

  1. Name: IS_NULL
    • SQL semantic: expr IS NULL
    • Since version: 3.3.0
  2. Name: IS_NOT_NULL
    • SQL semantic: expr IS NOT NULL
    • Since version: 3.3.0
  3. Name: STARTS_WITH
    • SQL semantic: expr1 LIKE 'expr2%'
    • Since version: 3.3.0
  4. Name: ENDS_WITH
    • SQL semantic: expr1 LIKE '%expr2'
    • Since version: 3.3.0
  5. Name: CONTAINS
    • SQL semantic: expr1 LIKE '%expr2%'
    • Since version: 3.3.0
  6. Name: IN
    • SQL semantic: expr IN (expr1, expr2, ...)
    • Since version: 3.3.0
  7. Name: =
    • SQL semantic: expr1 = expr2
    • Since version: 3.3.0
  8. Name: <>
    • SQL semantic: expr1 <> expr2
    • Since version: 3.3.0
  9. Name: <=>
    • SQL semantic: null-safe version of expr1 = expr2
    • Since version: 3.3.0
  10. Name: <
    • SQL semantic: expr1 < expr2
    • Since version: 3.3.0
  11. Name: <=
    • SQL semantic: expr1 <= expr2
    • Since version: 3.3.0
  12. Name: >
    • SQL semantic: expr1 > expr2
    • Since version: 3.3.0
  13. Name: >=
    • SQL semantic: expr1 >= expr2
    • Since version: 3.3.0
  14. Name: AND
    • SQL semantic: expr1 AND expr2
    • Since version: 3.3.0
  15. Name: OR
    • SQL semantic: expr1 OR expr2
    • Since version: 3.3.0
  16. Name: NOT
    • SQL semantic: NOT expr
    • Since version: 3.3.0
  17. Name: ALWAYS_TRUE
    • SQL semantic: TRUE
    • Since version: 3.3.0
  18. Name: ALWAYS_FALSE
    • SQL semantic: FALSE
    • Since version: 3.3.0
Since:
3.3.0
See Also:
  • Constructor Details