MaxGekk commented on a change in pull request #30516:
URL: https://github.com/apache/spark/pull/30516#discussion_r600828288
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/intervalExpressions.scala
##########
@@ -215,19 +227,20 @@ case class MakeInterval(
min.asInstanceOf[Int],
sec.map(_.asInstanceOf[Decimal]).getOrElse(Decimal(0,
Decimal.MAX_LONG_DIGITS, 6)))
} catch {
- case _: ArithmeticException => null
+ case _: ArithmeticException if !failOnError => null
}
}
override def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = {
nullSafeCodeGen(ctx, ev, (year, month, week, day, hour, min, sec) => {
val iu = IntervalUtils.getClass.getName.stripSuffix("$")
val secFrac = sec.getOrElse("0")
+ val faileOnErrorBranch = if (failOnError) "throw e;" else s"${ev.isNull}
= true;"
Review comment:
Is `faile` typo? `faileOnErrorBranch` -> `failOnErrorBranch`. I will fix
this in https://github.com/apache/spark/pull/31951.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]