You are viewing documentation about an older version (1.3.0). View latest version

snowflake.snowpark.functions.lpad

snowflake.snowpark.functions.lpad(e: ColumnOrName, len: Column | int, pad: ColumnOrName) Column[source]

Left-pads a string with characters from another string, or left-pads a binary value with bytes from another binary value.

Example:

>>> from snowflake.snowpark.functions import lit
>>> df = session.create_dataframe([["a"], ["b"], ["c"]], schema=["a"])
>>> df.select(lpad(col("a"), 3, lit("k")).alias("result")).show()
------------
|"RESULT"  |
------------
|kka       |
|kkb       |
|kkc       |
------------
Copy