[SPARK-57830][SS] Support event-time watermark on nanosecond-precision timestamp columns#56944
Open
yadavay-amzn wants to merge 2 commits into
Open
[SPARK-57830][SS] Support event-time watermark on nanosecond-precision timestamp columns#56944yadavay-amzn wants to merge 2 commits into
yadavay-amzn wants to merge 2 commits into
Conversation
…n timestamp columns
…tesWithinWatermark until SPARK-57843
Member
|
@HeartSaVioR Could you review this PR, please. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Allows nanosecond-precision timestamp columns (
TimestampNTZNanosType,TimestampLTZNanosType) to be used as the event-time column for Structured Streaming watermarks.withWatermark's analyzer type-check now accepts these types, andEventTimeWatermarkExecconverts the nanosecond event-time value to milliseconds for watermark tracking on the correct scale (epochMicros->microsToMillis), matching the existing microsecond-timestamp path. The watermark eviction literal is constructed with the correct nanosecond type.Why are the changes needed?
Part of nanosecond-precision timestamp support (SPARK-56822). Streaming queries using a nanosecond-precision timestamp as the event-time column previously failed the
withWatermarktype-check (EVENT_TIME_IS_NOT_ON_TIMESTAMP_TYPE).Does this PR introduce any user-facing change?
Yes -
withWatermarknow accepts nanosecond-precision timestamp event-time columns; the watermark advances identically to an equivalent microsecond-timestamp column.How was this patch tested?
New
EventTimeWatermarkSuitetests for LTZ-nanos and NTZ-nanos event-time columns asserting correct watermark advancement, plus a microsecond/nanosecond equivalence test. AllEventTimeWatermarkSuitetests pass.Limitations / follow-ups
This PR covers the watermark itself (event-time column acceptance + advancement).
window/session_window/window_timeover nanosecond timestamps and full nanosecond support in streaming stateful operators (e.g.dropDuplicatesWithinWatermark) are tracked as follow-ups (SPARK-57829, SPARK-57843); using a nanosecond-precision event-time column withdropDuplicatesWithinWatermarknow raises a clear analysis error until SPARK-57843 adds support, rather than silently mishandling it.Was this patch authored or co-authored using generative AI tooling?
Authored with assistance by Claude Opus 4.8.