ilike
Returns true if str matches pattern with escape case-insensitively, null if any arguments are null, false otherwise. The default escape character is the ''.
For the corresponding Databricks SQL function, see ilike operator.
Syntax
Python
from pyspark.databricks.sql import functions as dbf
dbf.ilike(str=<str>, pattern=<pattern>, escapeChar=<escapeChar>)
Parameters
Parameter | Type | Description |
|---|---|---|
|
| A string. |
|
| A string pattern where _ matches any one character and % matches zero or more characters. |
|
| An escape character. The default escape character is the ''. |
Examples
Python
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([("Spark", "_park")], ['a', 'b'])
df.select(dbf.ilike(df.a, df.b).alias('r')).collect()
Output
[Row(r=True)]