MaxGekk commented on code in PR #56677:
URL: https://github.com/apache/spark/pull/56677#discussion_r3460526004
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:
##########
@@ -1932,6 +1995,10 @@ case class Cast(
val zid = zoneIdValue(ctx)
(c, evPrim, evNull) =>
code"$evPrim = $dateTimeUtilsCls.convertTz($c.epochMicros,
java.time.ZoneOffset.UTC, $zid);"
+ case _: TimeType =>
+ val zid = zoneIdValue(ctx)
+ (c, evPrim, evNull) =>
+ code"$evPrim =
$dateTimeUtilsCls.makeTimestampNTZ($dateTimeUtilsCls.currentDate($zid), $c);"
Review Comment:
Right — this is only the eval/codegen fallback for a directly-evaluated
Cast; the real query path is rewritten by ComputeCurrentTime into a builder
anchored on the query-stable current-date literal, so the across-midnight
concern doesn't apply there. The per-row currentDate(zoneId) read here is
consistent with how the other current_* eval fallbacks behave. Leaving as-is
intentionally.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]