Is there a way to split a snowpark dataframe column based on a string?
Here is what I have tried so far
from snowflake.snowpark import Session
from snowflake.snowpark import functions as SF
connection_parameters = {
"account": "myaccount",
"user": "myuser",
}
session = Session.builder.configs(connection_parameters).create()
dh_session = session.table('tableName')
dh = dh_session.select(SF.to_timestamp(SF.col("timestamp")).as_("timestamp"),SF.col("name"))
# Split the name column by string delimiter '-AA' and get the first part
dh.select(SF.split("name",SF.lit("-AA").get_value(0)).as_("test")).show()
However I get an error message
AttributeError: 'Column' object has no attribute 'getItem'
Thanks