Column.
like
SQL like expression. Returns a boolean Column based on a SQL LIKE match.
Column
Changed in version 3.4.0: Supports Spark Connect.
a SQL LIKE pattern
Column of booleans showing whether each element in the Column is matched by SQL LIKE pattern.
See also
pyspark.sql.Column.rlike
Examples
>>> df = spark.createDataFrame( ... [(2, "Alice"), (5, "Bob")], ["age", "name"]) >>> df.filter(df.name.like('Al%')).collect() [Row(age=2, name='Alice')]