Skip to content

feat(connectors): implement Avro payload support with separate encoder, decoder and transform crates#3141

Open
Tyooughtul wants to merge 5 commits intoapache:masterfrom
Tyooughtul:feat/1846-avro-support
Open

feat(connectors): implement Avro payload support with separate encoder, decoder and transform crates#3141
Tyooughtul wants to merge 5 commits intoapache:masterfrom
Tyooughtul:feat/1846-avro-support

Conversation

@Tyooughtul
Copy link
Copy Markdown
Contributor

@Tyooughtul Tyooughtul commented Apr 20, 2026

Which issue does this PR close?

Closes #1846

Rationale

Issue #1846 requested support for Apache Avro as a first-class payload format in connectors, including dedicated StreamEncoder / StreamDecoder implementations and cross-format transformations. This PR delivers that support with schema-driven encoding/decoding and runtime integration.

What changed?

What changed?

Connectors only supported JSON, Raw, Text, Proto and FlatBuffer payloads. Avro data had to be handled as opaque raw bytes without schema validation or format conversion.
So, I added full Avro support across the connector stack, SDK-level AvroStreamEncoder/Decoder with inline/file-based schema loading, a new AvroConvert transform for cross-format conversion, runtime config fields for producers/consumers, and HTTP sink base64 encoding for Avro payloads.

Local Execution

  • Passed / not passed
    Passed
  • Pre-commit hooks ran / not ran
    Ran

AI Usage

I used codex to check the code I wrote, and it helped me discover some bugs and wrote the pr draft.

- Add apache-avro dependency to workspace and SDK crate
- Extend Payload and Schema enums with Avro variant
- Implement AvroStreamDecoder with JSON extraction and raw passthrough
- Implement AvroStreamEncoder with JSON-to-Avro conversion and field mappings
- Update FlatBuffer and Proto encoders to handle Payload::Avro
- Update ProtoConvert transform to support Avro format conversion
- Implement AvroConvert supporting Avro <-> JSON/Text/Raw conversions
- Register AvroConvert in TransformType and from_config dispatch
- Add avro_schema_json and avro_schema_path to stream configs
- Use AvroStreamDecoder in sink setup for Schema::Avro
- Use AvroStreamEncoder in source setup for Schema::Avro
- Base64-encode Payload::Avro with metadata marker for HTTP transport
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 20, 2026

Codecov Report

❌ Patch coverage is 72.57257% with 274 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.64%. Comparing base (2d6562b) to head (e426d71).

Files with missing lines Patch % Lines
core/connectors/sdk/src/encoders/avro.rs 72.61% 105 Missing and 7 partials ⚠️
core/connectors/sdk/src/transforms/avro_convert.rs 76.98% 51 Missing and 4 partials ⚠️
core/connectors/sdk/src/decoders/avro.rs 82.63% 43 Missing and 7 partials ⚠️
core/connectors/runtime/src/sink.rs 21.42% 11 Missing ⚠️
core/connectors/runtime/src/source.rs 21.42% 11 Missing ⚠️
core/connectors/sdk/src/encoders/proto.rs 0.00% 11 Missing ⚠️
...ore/connectors/sdk/src/transforms/proto_convert.rs 0.00% 7 Missing ⚠️
core/connectors/sinks/http_sink/src/lib.rs 0.00% 7 Missing ⚠️
core/connectors/sdk/src/lib.rs 0.00% 6 Missing ⚠️
core/connectors/sdk/src/transforms/mod.rs 0.00% 3 Missing ⚠️
... and 1 more
Additional details and impacted files
@@              Coverage Diff              @@
##             master    #3141       +/-   ##
=============================================
- Coverage     73.17%   59.64%   -13.54%     
  Complexity      943      943               
=============================================
  Files          1123     1125        +2     
  Lines         97892    89792     -8100     
  Branches      75065    66984     -8081     
=============================================
- Hits          71632    53554    -18078     
- Misses        23671    33621     +9950     
- Partials       2589     2617       +28     
Components Coverage Δ
Rust Core 55.77% <72.57%> (-18.28%) ⬇️
Java SDK 62.30% <ø> (ø)
C# SDK 69.10% <ø> (-0.31%) ⬇️
Python SDK 81.43% <ø> (ø)
Node SDK 91.40% <ø> (+0.10%) ⬆️
Go SDK 39.41% <ø> (ø)
Files with missing lines Coverage Δ
core/connectors/runtime/src/configs/connectors.rs 28.18% <ø> (ø)
core/connectors/sdk/src/encoders/flatbuffer.rs 80.65% <0.00%> (-0.34%) ⬇️
core/connectors/sdk/src/transforms/mod.rs 29.62% <0.00%> (-3.71%) ⬇️
core/connectors/sdk/src/lib.rs 56.17% <0.00%> (-4.07%) ⬇️
...ore/connectors/sdk/src/transforms/proto_convert.rs 72.34% <0.00%> (-0.68%) ⬇️
core/connectors/sinks/http_sink/src/lib.rs 85.70% <0.00%> (-0.58%) ⬇️
core/connectors/runtime/src/sink.rs 72.40% <21.42%> (-2.12%) ⬇️
core/connectors/runtime/src/source.rs 68.07% <21.42%> (-1.42%) ⬇️
core/connectors/sdk/src/encoders/proto.rs 70.54% <0.00%> (-1.08%) ⬇️
core/connectors/sdk/src/decoders/avro.rs 82.63% <82.63%> (ø)
... and 2 more

... and 224 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Tyooughtul Tyooughtul changed the title Feat/1846 avro support feat/1846 avro support Apr 20, 2026
@Tyooughtul Tyooughtul changed the title feat/1846 avro support feat(connectors): implement Avro payload support with separate encoder, decoder and transform crates Apr 20, 2026
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.

Add support for Avro payload to connectors runtime

1 participant