SPRKPY1044

pyspark.sql.functions.split has workaround

Description

This issue appears when the tool detects the usage of pyspark.sql.functions.split which has a workaround.

Input code:

F.split('col', '\\|')

Output code:

#EWI: SPRKPY1044 => pyspark.sql.functions.split has a workaround, see the documentation for more info
F.split('col', '\\|')

Scenarios

split(str: ColumnOrName, pattern: str, limit: int = - 1) → pyspark.sql.column.Column

When the function call has just the str and pattern parameters Action: you can call the function snowflake.snowpark.functions.lit with the pattern parameter and send it into the split. Example:

F.split('col', lit('\\|'))
# the result of lit will be sent to the split function

When the function call has the str, pattern, and limit parameters Action: This case is not supported. Example:

F.split('col', '\\|', 1)
# the limit parameter is not supported by snowflake

Recommendation

  • For more support, you can email us at snowconvert-info@snowflake.com. If you have a contract for support with Snowflake, reach out to your sales engineer and they can direct your support needs.