HeartSaVioR commented on a change in pull request #23660:
[SPARK-26379][SS][FOLLOWUP] Use dummy TimeZoneId to avoid UnresolvedException
in CurrentBatchTimestamp
URL: https://github.com/apache/spark/pull/23660#discussion_r251198597
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/MicroBatchExecution.scala
##########
@@ -501,27 +501,22 @@ class MicroBatchExecution(
// Rewire the plan to use the new attributes that were returned by the
source.
val newAttributePlan = newBatchesPlan transformAllExpressions {
case ct: CurrentTimestamp =>
+ // CurrentTimestamp is not TimeZoneAwareExpression while
CurrentBatchTimestamp is.
+ // Without TimeZoneId, CurrentBatchTimestamp is unresolved. Here, we
use an explicit
+ // dummy string to prevent UnresolvedException and to prevent to be
used in the future.
CurrentBatchTimestamp(offsetSeqMetadata.batchTimestampMs,
- ct.dataType)
+ ct.dataType, Some("Dummy TimeZoneId"))
Review comment:
Thanks for providing nice analysis and looks like this patch is simpler and
more concise. Nice!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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]