snowflake.snowpark.functions.left

snowflake.snowpark.functions.left(str_expr: Union[Column, str], length: Union[Column, int]) Column[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.26.0/snowpark-python/src/snowflake/snowpark/functions.py#L3555-L3576)

Returns a left most substring of str_expr.

Example:

>>> df = session.create_dataframe([["abc"], ["def"]], schema=["a"])
>>> df.select(left(col("a"), 2).alias("result")).show()
------------
|"RESULT"  |
------------
|ab        |
|de        |
------------
Copy
Language: English