Github user hvanhovell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16870#discussion_r100539828
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala
 ---
    @@ -465,15 +465,15 @@ case class DateFormatClass(left: Expression, right: 
Expression, timeZoneId: Opti
         copy(timeZoneId = Option(timeZoneId))
     
       override protected def nullSafeEval(timestamp: Any, format: Any): Any = {
    -    val df = DateTimeUtils.newDateFormat(format.toString, timeZone)
    +    val df = DateTimeUtils.newDateFormat(format.toString, timeZone, 
isLenient = true)
         UTF8String.fromString(df.format(new 
java.util.Date(timestamp.asInstanceOf[Long] / 1000)))
       }
     
       override def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = {
         val dtu = DateTimeUtils.getClass.getName.stripSuffix("$")
         val tz = ctx.addReferenceMinorObj(timeZone)
         defineCodeGen(ctx, ev, (timestamp, format) => {
    -      s"""UTF8String.fromString($dtu.newDateFormat($format.toString(), $tz)
    +      s"""UTF8String.fromString($dtu.newDateFormat($format.toString(), 
$tz, false)
    --- End diff --
    
    Why is this one not lenient?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to