Skip to content

kafka sink: Fix: Correctly write out negative timestamps with Avro#35426

Merged
def- merged 1 commit intoMaterializeInc:mainfrom
def-:pr-avro-negative-timestamps
Mar 13, 2026
Merged

kafka sink: Fix: Correctly write out negative timestamps with Avro#35426
def- merged 1 commit intoMaterializeInc:mainfrom
def-:pr-avro-negative-timestamps

Conversation

@def-
Copy link
Copy Markdown
Contributor

@def- def- commented Mar 11, 2026

Another one-liner fix, the rest is adding a test.

This has been broken since the very beginning: #2181, but probably only became relevant with Kafka sinks being introduced.

timestamp-micros: logical type annotates an Avro long, where the long stores the number of microseconds from the unix epoch, 1 January 1970 00:00:00.000000.

From https://avro.apache.org/docs/1.12.0/specification/#logical-types

Another one-liner fix, the rest is adding a test.

This has been broken since the very beginning: MaterializeInc#2181
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for opening this PR! Here are a few tips to help make the review process smooth for everyone.

PR title guidelines

  • Use imperative mood: "Fix X" not "Fixed X" or "Fixes X"
  • Be specific: "Fix panic in catalog sync when controller restarts" not "Fix bug" or "Update catalog code"
  • Prefix with area if helpful: compute: , storage: , adapter: , sql:

Pre-merge checklist

  • The PR title is descriptive and will make sense in the git log.
  • This PR has adequate test coverage / QA involvement has been duly considered. (trigger-ci for additional test/nightly runs)
  • If this PR includes major user-facing behavior changes, I have pinged the relevant PM to schedule a changelog post.
  • This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
  • If this PR evolves an existing $T ⇔ Proto$T mapping (possibly in a backwards-incompatible way), then it is tagged with a T-proto label.
  • If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label (example).

@def- def- changed the title kafka: Correctly handle negative timestamps with Avro kafka sink: Correctly handle negative timestamps with Avro Mar 11, 2026
@def- def- changed the title kafka sink: Correctly handle negative timestamps with Avro kafka sink: Fix: Correctly write out negative timestamps with Avro Mar 11, 2026
@def- def- requested a review from DAlperin March 11, 2026 13:27
@def- def- marked this pull request as ready for review March 11, 2026 13:28
@def- def- requested a review from a team as a code owner March 11, 2026 13:28
Copy link
Copy Markdown
Member

@DAlperin DAlperin left a comment

Choose a reason for hiding this comment

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

Good catch. Thanks!

@def- def- merged commit 4db966d into MaterializeInc:main Mar 13, 2026
127 checks passed
@def- def- deleted the pr-avro-negative-timestamps branch March 13, 2026 12:47
antiguru pushed a commit to antiguru/materialize that referenced this pull request Mar 26, 2026
…aterializeInc#35426)

Another one-liner fix, the rest is adding a test.

This has been broken since the very beginning:
MaterializeInc#2181, but probably
only became relevant with Kafka sinks being introduced.

> timestamp-micros: logical type annotates an Avro long, where the long
stores the number of microseconds from the unix epoch, 1 January 1970
00:00:00.000000.

From https://avro.apache.org/docs/1.12.0/specification/#logical-types
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.

2 participants