Skip to content

Commit a557bb0

Browse files
committed
fix missing api in spark40 shim
Signed-off-by: Yuan <[email protected]>
1 parent 2d2119f commit a557bb0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

shims/spark40/src/main/scala/org/apache/gluten/sql/shims/spark40/Spark40Shims.scala

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,22 @@ class Spark40Shims extends SparkShims {
700700
plan.offset
701701
}
702702

703+
override def extractExpressionTimestampAddUnit(exp: Expression): Option[Seq[String]] = {
704+
exp match {
705+
case timestampAdd: TimestampAdd =>
706+
Option.apply(Seq(timestampAdd.unit, timestampAdd.timeZoneId.getOrElse("")))
707+
case _ => Option.empty
708+
}
709+
}
710+
711+
override def extractExpressionTimestampDiffUnit(exp: Expression): Option[String] = {
712+
exp match {
713+
case timestampDiff: TimestampDiff =>
714+
Some(timestampDiff.unit)
715+
case _ => Option.empty
716+
}
717+
}
718+
703719
override def widerDecimalType(d1: DecimalType, d2: DecimalType): DecimalType = {
704720
DecimalPrecisionTypeCoercion.widerDecimalType(d1, d2)
705721
}

0 commit comments

Comments
 (0)