Skip to content

fix(codecs): support Avro Date and TimeMillis logical types - #26112

Merged
pront merged 17 commits into
vectordotdev:masterfrom
omwbennett:support-avro-date-timemillis
Oct 13, 2026
Merged

pront merged 17 commits into
vectordotdev:masterfrom
omwbennett:support-avro-date-timemillis

Conversation

@omwbennett

Copy link
Copy Markdown
Contributor

Summary

Support encoding and decoding Avro Date and TimeMillis values.
Due to the way VRL stores integers, an extra step was added to the avro encoder path to coerce Avro types based on the schema field's logical type.

References

Closes #24773

Vector configuration

sources:
  kafka_avro:
    type: kafka
    bootstrap_servers: "kafka:9092"
    group_id: "vector"
    topics:
      - test_topic
    decoding:
      codec: avro
      avro:
        schema: |
          {
            "type": "record",
            "name": "test",
            "fields": [
              {
                "name": "date_field",
                "type": { "type": "int", "logicalType": "date" }
              }
            ]
          }
        strip_schema_id_prefix: false

sinks:
  console_out:
    type: console
    inputs:
      - kafka_avro
    encoding:
      codec: json

And similar for TimeMillis.

How did you test this PR?

Manual testing with the above configs, added unit tests for coerce_logical_types and enabled the existing date/timemillis avro round trip tests. All tests passing.

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

Contributor Guidelines

  • Please read our Vector contributor resources.
  • Do not hesitate to use @vectordotdev/vector to reach out to us regarding this PR.
  • Some CI checks run only after we manually approve them. To catch issues early, add a pre-push hook (template) or run the following locally before pushing:
    • make fmt
    • make check-clippy (auto-fix with make clippy-fix)
    • make test
  • After a review is requested, please avoid force pushes to help us review incrementally.
    • Feel free to push as many commits as you want. They will be squashed into one before merging.
    • For example, you can run git merge origin master and git push.
  • If this PR introduces changes Vector dependencies (modifies Cargo.lock), please
    run make build-licenses to regenerate the license inventory and commit the changes (if any). More details on the dd-rust-license-tool.

@omwbennett
omwbennett requested review from a team as code owners August 14, 2026 13:12
@github-actions github-actions Bot added docs review on hold The documentation team reviews PRs only after a PR is approved by the COSE team. domain:external docs Anything related to Vector's external, public documentation labels Aug 14, 2026
@omwbennett omwbennett mentioned this pull request Aug 14, 2026
2 of 8 tasks

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0ca77c6bfb

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread lib/codecs/src/encoding/format/avro.rs Resolved
Comment thread lib/codecs/src/encoding/format/avro.rs Resolved
@pront
pront enabled auto-merge August 17, 2026 16:58
@pront
pront added this pull request to the merge queue Aug 18, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 18, 2026
@pront
pront enabled auto-merge August 18, 2026 20:14

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4808acf3b0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/codecs/src/encoding/format/avro.rs Resolved
@pront pront added the meta:awaiting author Pull requests that are awaiting their author. label Aug 18, 2026
auto-merge was automatically disabled August 19, 2026 06:51

Head branch was pushed to by a user without write access

@github-actions github-actions Bot removed the meta:awaiting author Pull requests that are awaiting their author. label Aug 19, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9b6ef3c523

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread lib/codecs/src/encoding/format/avro.rs Resolved
@omwbennett omwbennett mentioned this pull request Aug 19, 2026
2 of 4 tasks

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5a43236ddf

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@github-actions github-actions Bot removed the docs review on hold The documentation team reviews PRs only after a PR is approved by the COSE team. label Sep 1, 2026
@jeff-morgan-dd jeff-morgan-dd self-assigned this Sep 1, 2026
@omwbennett

Copy link
Copy Markdown
Contributor Author

Hey @pront this PR should be good to go now that avro-rs was updated to 0.22.0

@pront

pront commented Sep 22, 2026

Copy link
Copy Markdown
Member

Hey @pront this PR should be good to go now that avro-rs was updated to 0.22.0

Hi @omwbennett, please rebase on master / regenerate docs

@omwbennett
omwbennett force-pushed the support-avro-date-timemillis branch from 66af296 to 721b21b Compare September 23, 2026 15:18
Comment thread lib/codecs/src/encoding/format/avro.rs Resolved
thomasqueirozb and others added 2 commits October 7, 2026 18:17
Keep the original input when the union compatibility check succeeds so final resolution cannot switch branches and discard fields.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@pront
pront enabled auto-merge October 9, 2026 15:31
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T15:54:18.280661Z d7e4fd4 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

auto-merge was automatically disabled October 13, 2026 15:47

Head branch was pushed to by a user without write access

@pront
pront enabled auto-merge October 13, 2026 16:52
@pront
pront added this pull request to the merge queue Oct 13, 2026
Merged via the queue into vectordotdev:master with commit 0628152 Oct 13, 2026
61 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

domain:external docs Anything related to Vector's external, public documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Avro decoder doesn't support Date values

4 participants