endswith (列)

文字列列が部分文字列で終わるかどうかを確認します。

構文

endswith(other)

パラメーター

パラメーター タイプ 説明
other str または Column チェックするサフィックスを含む文字列または列

返品

列 (ブール値)

例示

df = spark.createDataFrame(
     [(2, "Alice"), (5, "Bob")], ["age", "name"])
df.filter(df.name.endswith('ice')).collect()
# [Row(age=2, name='Alice')]
df.filter(df.name.endswith('ice$')).collect()
# []