Skip to content

[connectors][clock] Support time zone offset for the NOW() connector - #6745

Merged
mihaibudiu merged 3 commits into
feldera:mainfrom
mihaibudiu:issue6710
Jul 30, 2026
Merged

[connectors][clock] Support time zone offset for the NOW() connector#6745
mihaibudiu merged 3 commits into
feldera:mainfrom
mihaibudiu:issue6710

Conversation

@mihaibudiu

Copy link
Copy Markdown
Contributor

Fixes #6710

A new configuration value for the pipeline can be used to specify a constant time-zone offset for the NOW() clock.
This offset is applied to all clock values returned. Note that the offset cannot be changed unless storage is cleared, because the NOW() clock is designed to always be monotonic.

Checklist

  • Unit tests added/updated
  • Integration tests added/updated
  • Documentation updated

@blp

blp commented Jul 28, 2026

Copy link
Copy Markdown
Member

Is this useful enough? Real timezones change offset for DST.

@mythical-fred mythical-fred left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Offset is pinned in the controller merge, rejected by update_pipeline while storage is in use, and covered end-to-end by both Rust and Python tests. The #[serde(default, skip_serializing_if = "is_zero")] on timezone_offset_ms keeps old checkpoints readable. blp's DST point is real but the docs explicitly frame this as a constant offset that does not track any geographic timezone, which is the right choice for a monotone clock.

@mihaibudiu

Copy link
Copy Markdown
Contributor Author

Yes, we cannot change offsets. The user who requested this claimed that's good enough.
If you want to change timezones there's already a CONVERT_TIMEZONE function.

@mihaibudiu

Copy link
Copy Markdown
Contributor Author

Maybe that's because the user's example uses Shanghai, and China has no DST.

@mihaibudiu

Copy link
Copy Markdown
Contributor Author

Hopefully it will be applicable to US soon too.

@mihaibudiu

Copy link
Copy Markdown
Contributor Author

But only for future timestamps, I guess.

@mihaibudiu

Copy link
Copy Markdown
Contributor Author

@Mrhs121 can you please take a look? If you use the open-source version of the software maybe you can even try this?

@mihaibudiu
mihaibudiu force-pushed the issue6710 branch 2 times, most recently from 6607283 to 61c3678 Compare July 28, 2026 23:18
@Mrhs121

Mrhs121 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

@Mrhs121 can you please take a look? If you use the open-source version of the software maybe you can even try this?

Thanks for implementing this and for the ping. I reviewed the changes, and a fixed immutable +08:00 offset is sufficient for our use case. Our source data contains timezone-naive Asia/Shanghai timestamps, and we do not need DST handling.

We currently carry a small internal patch that hard-codes an 8-hour offset when producing the NOW() clock record. This PR is a much more complete solution: the offset is configurable, UTC remains the default, and checkpoint/replay behavior is handled correctly. From both the implementation and use-case perspective, LGTM. Once this is merged, we plan to replace our hard-coded internal patch.

@mihaibudiu
mihaibudiu added this pull request to the merge queue Jul 30, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 30, 2026
Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
@mihaibudiu

Copy link
Copy Markdown
Contributor Author

I think this needs to be merged in 2 steps, the platform does not know about the new setting, so it cannot run the new python test correctly. So I will disable the test, merge, and then re-enable the test after the platform has been updated.

Signed-off-by: Mihai Budiu <mbudiu@feldera.com>

@mythical-fred mythical-fred left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review at b85adbd. Ahead 23/behind 2 since 61c3678; substantively three PR-authored commits:

  • b79ba85 timezone-offset feature: byte-identical file list & line counts to the previously approved rebase (adapters/controller.rs +12, transport/clock.rs +297/-32, feldera-types config.rs +15/-1, feldera-types transport/clock.rs +117/-1, examples.rs +1, db/operations/pipeline.rs +12, db/test.rs +19, configuration.mdx +1, datetime.md +23, openapi.json +29, runtime_config.py +2, python test_clock_timezone_offset.py +139). Prior APPROVE stands.
  • b59c4d3 docs typos: pure prose (millenium->millennium, WEEK ISO-8601 rewrite, nanosecond digit fix, sql_tsi_second anchor, TIMESTAMPDIFF example, timestamp FLOOR upward->downward, synonim->synonym, tiemUnit->timeUnit). All correct.
  • b85adbd disables the python integration test by renaming test_clock_timezone_offset.py -> .py.enableme. Effective (pytest won't collect it) and easy to grep. Non-blocking nit: consider a tracking issue reference in the commit message or a stub test_clock_timezone_offset_disabled.py with pytest.skip("re-enable after platform upgrade, see #NNNN") so the disable is discoverable without knowing the .enableme convention. Not blocking.

Approving.

Merged via the queue into feldera:main with commit d5221d7 Jul 30, 2026
1 check passed
@mihaibudiu
mihaibudiu deleted the issue6710 branch July 30, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support an immutable pipeline timezone for NOW()

5 participants