Skip to content

feat(connectors): add BSON payload support to connectors runtime#3299

Draft
Standing-Man wants to merge 6 commits into
apache:masterfrom
Standing-Man:bson-payload
Draft

feat(connectors): add BSON payload support to connectors runtime#3299
Standing-Man wants to merge 6 commits into
apache:masterfrom
Standing-Man:bson-payload

Conversation

@Standing-Man

@Standing-Man Standing-Man commented May 22, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #1847.

Rationale

What changed?

Local Execution

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

AI Usage

@github-actions

Copy link
Copy Markdown

Thanks for the pull request. It is now waiting for review, labeled S-waiting-on-review.

You can update that label as the review goes back and forth, with slash commands - each on its own line, in a regular PR comment (not an inline review reply):

  • /ready - mark it S-waiting-on-review again, after addressing feedback
  • /author - mark it S-waiting-on-author (maintainers, or anyone who has had a PR merged before)
  • /request-review @user ... - request reviewers (@user or @org/team)

Commands take up to ~90s to apply. If no reaction (👍 or 😕) appears on your comment, the apply step likely failed - check the repo's Actions tab for the PR Triage Apply run. Commands posted inside a review body (rather than a normal comment) cannot be reacted to, so they stay log-only.

See CONTRIBUTING.md for details.

@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label May 22, 2026
@Standing-Man Standing-Man marked this pull request as draft May 22, 2026 12:15
@github-actions github-actions Bot removed the S-waiting-on-review PR is waiting on a reviewer label May 22, 2026
@codecov

codecov Bot commented May 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.94444% with 234 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.69%. Comparing base (7b79dbd) to head (43103c7).
⚠️ Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
core/connectors/sdk/src/encoders/avro.rs 81.48% 96 Missing and 16 partials ⚠️
core/connectors/sdk/src/encoders/proto.rs 82.77% 80 Missing and 17 partials ⚠️
core/connectors/sdk/src/encoders/bson.rs 78.37% 7 Missing and 1 partial ⚠️
core/connectors/sdk/src/lib.rs 12.50% 7 Missing ⚠️
core/connectors/sinks/s3_sink/src/formatter.rs 84.61% 2 Missing and 2 partials ⚠️
core/connectors/sdk/src/decoders/bson.rs 92.00% 1 Missing and 1 partial ⚠️
...ore/connectors/sdk/src/transforms/proto_convert.rs 0.00% 2 Missing ⚠️
core/connectors/sdk/src/encoders/flatbuffer.rs 0.00% 1 Missing ⚠️
core/connectors/sinks/http_sink/src/lib.rs 94.44% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             master    #3299       +/-   ##
=============================================
- Coverage     73.47%   52.69%   -20.78%     
  Complexity      937      937               
=============================================
  Files          1286     1291        +5     
  Lines        141300   126392    -14908     
  Branches     117132   102025    -15107     
=============================================
- Hits         103819    66602    -37217     
- Misses        34235    56891    +22656     
+ Partials       3246     2899      -347     
Components Coverage Δ
Rust Core 47.78% <81.94%> (-25.91%) ⬇️
Java SDK 62.44% <ø> (ø)
C# SDK 71.05% <ø> (-1.06%) ⬇️
Python SDK 92.17% <ø> (ø)
PHP SDK 84.29% <ø> (ø)
Node SDK 91.22% <ø> (-0.12%) ⬇️
Go SDK 42.28% <ø> (ø)
Files with missing lines Coverage Δ
core/connectors/sinks/surrealdb_sink/src/lib.rs 85.14% <100.00%> (+0.12%) ⬆️
core/connectors/sdk/src/encoders/flatbuffer.rs 80.32% <0.00%> (-0.34%) ⬇️
core/connectors/sinks/http_sink/src/lib.rs 85.82% <94.44%> (+0.04%) ⬆️
core/connectors/sdk/src/decoders/bson.rs 92.00% <92.00%> (ø)
...ore/connectors/sdk/src/transforms/proto_convert.rs 72.14% <0.00%> (-0.20%) ⬇️
core/connectors/sinks/s3_sink/src/formatter.rs 84.04% <84.61%> (-0.13%) ⬇️
core/connectors/sdk/src/lib.rs 52.57% <12.50%> (-3.61%) ⬇️
core/connectors/sdk/src/encoders/bson.rs 78.37% <78.37%> (ø)
core/connectors/sdk/src/encoders/proto.rs 77.64% <82.77%> (+7.10%) ⬆️
core/connectors/sdk/src/encoders/avro.rs 78.47% <81.48%> (+5.85%) ⬆️

... and 388 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.

@hubcio

hubcio commented May 29, 2026

Copy link
Copy Markdown
Contributor

@Standing-Man what's the status for this one? I see that it's a draft, do you have plans to continue?

@Standing-Man

Copy link
Copy Markdown
Contributor Author

@Standing-Man what's the status for this one? I see that it's a draft, do you have plans to continue?

My schedule has been a bit tight recently. If time permits, I’ll continue working on this PR and move it forward.

That said, if the PR remains inactive for an extended period, other contributors are more than welcome to pick up the issue and continue the work.

@Standing-Man Standing-Man force-pushed the bson-payload branch 3 times, most recently from d4c1036 to 4202c70 Compare June 5, 2026 12:22
@hubcio

hubcio commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@Standing-Man no worries. PR stay as draft as long as you want. i just wanted to confirm whether you plan to work on it.

Signed-off-by: StandingMan <jmtangcs@gmail.com>
Signed-off-by: StandingMan <jmtangcs@gmail.com>
Enable the Avro stream encoder to convert BSON documents directly into
Avro values according to the configured schema, preserving BSON-specific
types and reporting conversion errors with precise field paths.

Resolve named Avro schema references during schema loading and cache the
resulting name index for reuse during BSON encoding. Refresh or clear the
cache on configuration updates while preserving the previous schema and
index when an update fails.

Add coverage for recursive BSON conversion, logical types, named schema
references, field mappings, error paths, and name-cache lifecycle behavior.

Signed-off-by: StandingMan <jmtangcs@gmail.com>
Reject BSON documents that omit fields required by the Avro schema instead
of silently converting missing fields to null.

Preserve support for explicit BSON null values when the corresponding Avro
field schema includes a null variant, and report missing fields with their
full document path.

Signed-off-by: StandingMan <jmtangcs@gmail.com>
Prevent BSON doubles and JSON numbers from silently overflowing or
underflowing when converted to Avro float values.

Use a shared checked conversion that rejects values outside the f32 range,
non-finite values, and non-zero values that underflow to zero. Add coverage
for valid boundaries and invalid BSON and JSON inputs.

Signed-off-by: StandingMan <jmtangcs@gmail.com>
BSON payloads require protobuf descriptors to determine field numbers,
wire types, nested message layouts, maps, enums, and oneof membership.

Build dynamic messages directly from BSON documents using runtime
descriptors instead of converting BSON through JSON. Support recursive
messages, repeated and map fields, enums, oneofs, binary values, BSON
object IDs, dates, numeric range validation, and precise field paths.

Signed-off-by: StandingMan <jmtangcs@gmail.com>
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 BSON payload to connectors runtime

2 participants