像(欄位)

SQL 類似的模式匹配。

語法

like(other)

參數

參數 類型 說明
other str SQL 類模式字串

退貨

欄位(布林)

Examples

df = spark.createDataFrame(
     [(2, "Alice"), (5, "Bob")], ["age", "name"])
df.filter(df.name.like('Al%')).collect()
# [Row(age=2, name='Alice')]