pyspark.sql.Column.ilike#

Column.ilike(other)[source]#

SQL ILIKE expression (case insensitive LIKE). Returns a boolean Column based on a case insensitive match.

New in version 3.3.0.

Changed in version 3.4.0: Supports Spark Connect.

Parameters
otherstr

a SQL LIKE pattern

Returns
Column

Column of booleans showing whether each element in the Column is matched by SQL LIKE pattern.

Examples

>>> df = spark.createDataFrame(
...      [(2, "Alice"), (5, "Bob")], ["age", "name"])
>>> df.filter(df.name.ilike('%Ice')).collect()
[Row(age=2, name='Alice')]