endswith (Coluna)

Verifica se uma coluna de strings termina com uma substring.

Sintaxe

endswith(other)

Parâmetros

Parâmetro Tipo Descrição
other str ou Column String ou Coluna contendo o sufixo para verificar

Devoluções

Coluna (booleana)

Exemplos

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()
# []