You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/11/27 06:24:33 UTC
[GitHub] [spark] waitinfuture commented on a change in pull request #30516: [SPARK-33498][SQL] Datetime building should fail if the year, month, ..., second combination is invalid
waitinfuture commented on a change in pull request #30516:
URL: https://github.com/apache/spark/pull/30516#discussion_r531403400
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala
##########
@@ -1776,23 +1776,29 @@ case class MakeDate(year: Expression, month: Expression, day: Expression)
override def dataType: DataType = DateType
override def nullable: Boolean = true
+ val ansiEnabled: Boolean = SQLConf.get.ansiEnabled
+
override def nullSafeEval(year: Any, month: Any, day: Any): Any = {
try {
val ld = LocalDate.of(year.asInstanceOf[Int], month.asInstanceOf[Int], day.asInstanceOf[Int])
localDateToDays(ld)
} catch {
- case _: java.time.DateTimeException => null
+ case e: java.time.DateTimeException =>
Review comment:
done
----------------------------------------------------------------
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org