MaxGekk commented on a change in pull request #27524: [WIP][SQL] Support
`SimpleDateFormat` and `FastDateFormat` as legacy date/timestamp formatters
URL: https://github.com/apache/spark/pull/27524#discussion_r377463939
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala
##########
@@ -831,12 +831,11 @@ abstract class ToTimestamp
}
case StringType =>
val zid = ctx.addReferenceObj("zoneId", zoneId,
classOf[ZoneId].getName)
- val locale = ctx.addReferenceObj("locale", Locale.US)
val tf = TimestampFormatter.getClass.getName.stripSuffix("$")
nullSafeCodeGen(ctx, ev, (string, format) => {
s"""
try {
- ${ev.value} = $tf$$.MODULE$$.apply($format.toString(), $zid,
$locale)
+ ${ev.value} =
$tf$$.MODULE$$.withStrongLegacy($format.toString(), $zid)
Review comment:
> is it because SIMPLE_DATE_FORMAT is an enum, and tricky for the codegen
part to reference?
Yes, let me figure out how to use Scala enum from Java
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]