-
Notifications
You must be signed in to change notification settings - Fork 278
Closed
Labels
Description
Summary
In Spark 4.1.0, the TimeAdd expression was renamed to TimestampAddInterval.
Details
- Spark Version: 4.1.0
- Change Type: Class rename
Spark ≤4.0.x
package org.apache.spark.sql.catalyst.expressions
case class TimeAdd(start: Expression, interval: Expression, ...)Spark 4.1.0+
package org.apache.spark.sql.catalyst.expressions
case class TimestampAddInterval(start: Expression, interval: Expression, ...)Impact
Code that references TimeAdd directly will fail to compile against Spark 4.1.0:
not found: type TimeAdd
Affected Files
sql-plugin/src/main/spark320/scala/com/nvidia/spark/rapids/shims/TimeAddShims.scalasql-plugin/src/main/spark330/scala/com/nvidia/spark/rapids/shims/DayTimeIntervalShims.scalasql-plugin/src/main/scala/org/apache/spark/sql/rapids/shims/GpuTimeAdd.scala
Solution
Create version-specific shims:
For Spark 3.2.0-4.0.x (spark320/ and spark330/):
- Use
TimeAddexpression inTimeAddShims.scala
For Spark 4.1.0+ (spark410/):
- Create empty
TimeAddShims.scala(returns empty map) - Handle
TimestampAddIntervalinDayTimeIntervalShims.scalawithGpuTimestampAddInterval
References
- Spark 4.0.1:
TimeAddexists - Spark 4.1.0: Renamed to
TimestampAddInterval
Reactions are currently unavailable