pyspark.sql.functions.rpad

pyspark.sql.functions.rpad(col: ColumnOrName, len: int, pad: str) → pyspark.sql.column.Column[source]

Right-pad the string column to width len with pad.

New in version 1.5.0.

Examples

>>> df = spark.createDataFrame([('abcd',)], ['s',])
>>> df.select(rpad(df.s, 6, '#').alias('s')).collect()
[Row(s='abcd##')]