You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2026/07/23 23:23:00 UTC

[jira] [Updated] (SPARK-58309) now() and current_timestamp() are not anchored to the batch timestamp in streaming queries

     [ https://issues.apache.org/jira/browse/SPARK-58309?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ASF GitHub Bot updated SPARK-58309:
-----------------------------------
    Labels: pull-request-available  (was: )

> now() and current_timestamp() are not anchored to the batch timestamp in streaming queries
> ------------------------------------------------------------------------------------------
>
>                 Key: SPARK-58309
>                 URL: https://issues.apache.org/jira/browse/SPARK-58309
>             Project: Spark
>          Issue Type: Bug
>          Components: Structured Streaming
>    Affects Versions: 4.2.0
>            Reporter: You Zhou
>            Priority: Major
>              Labels: pull-request-available
>
> In micro-batch streaming, CURRENT_LIKE temporal expressions are rewritten to CurrentBatchTimestamp so their value is anchored to the batch timestamp (persisted in the offset log) and is reproducible across batch replays/restarts. The rewrite in MicroBatchExecution only matched CurrentTimestamp, missing now() (Now, a sibling under CurrentTimestampLike) and current_time() (CurrentTime, which also needs a TimeType branch in CurrentBatchTimestamp.toLiteral). As a result these fold to wall-clock time at plan-optimization time and produce non-deterministic values on replay.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org