snowflake.snowpark.functions.lpad

snowflake.snowpark.functions.lpad(e: Union[Column, str], len: Union[Column, int], pad: Union[Column, str]) Column[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.16.0/src/snowflake/snowpark/functions.py#L2167-L2188)

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
语言: 中文