SPRKSCL1113

org.apache.spark.sql.functions.next_day has a workaround.

Description

This issue appears when the tool detects the usage of org.apache.spark.sql.functions.next_day which has a workaround.

Input code

val result = next_day(someColumn, "Mon")

Output code

/*EWI: SPRKSCL1113 => org.apache.spark.sql.functions.next_day has a workaround, see documentation for more info*/
val result = next_day(someColumn, "Mon")

Scenarios

This function has two overloads.

1. next_day(date: Column, dateOfWeek: Column)

Action: does not need any change.

2. next_day(date: Column, dateOfWeek: String)

Action: convert the second param to Column type using the com.snowflake.snowpark.functions.col function. For example:

val result = next_day(someColumn, col("Mon"))

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.