SPRKPY1020

pyspark.sql.functions.instr has a workaround

Category

Warning.

Description

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

Input code:

col = instr(colName, strValue)

Output code:

#EWI: SPRKPY1020 => pyspark.sql.functions.instr has a workaround, see documentation for more info
col = instr(colName, strValue)

Scenario:

instr(str: ColumnOrName, substr: str) Action: Requires a manual change by using the function charindex and changing the order of the first two parameters.

col = charindex(strValue, colName)

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.