Skip to content

[All] Add avro record type to proto surface - #811

Merged
irinatomic-db merged 3 commits into
mainfrom
irina-tomic_data/avro/proto-surface
Sep 3, 2026
Merged

irinatomic-db merged 3 commits into
mainfrom
irina-tomic_data/avro/proto-surface

Conversation

@irinatomic-db

@irinatomic-db irinatomic-db commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

PR stack

What changes are proposed in this pull request?

Adds the Avro record type to the proto surface (wire contract only) so later PRs can build Avro ingestion on ephemeral streams. No public SDK API and no behavior change yet.

  • Proto (rust/sdk/zerobus_service.proto):
    • reserve 3 (ARROW_IPC on the service - this SDK models Arrow as a separate Arrow Flight stream, not a RecordType)
    • add AVRO = 4;
    • add AvroRecordBatch, CreateIngestStreamRequest.avro_schema_json, IngestRecordRequest.avro_encoded_record, and IngestRecordBatchRequest.avro_batch.
  • purego: regenerate internal/zerobuspb bindings from the schema. The commit also resyncs pre-existing drift (proto doc-comments + gofmt) and adds a generate CI job that fails if the committed bindings are stale = the gate purego was missing.
  • Rust: set avro_schema_json: None at the one CreateIngestStreamRequest construction site so codegen compiles.

How is this tested?

# Rust - proto compiles + no regressions
cd rust
cargo build -p databricks-zerobus-ingest-sdk
cargo test  -p databricks-zerobus-ingest-sdk

# purego - bindings match the schema (the new CI gate), plus build/vet/test
cd ../purego/internal/zerobuspb
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36.11
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.6.2
go generate ./...
cd ../../..
git diff --exit-code -- purego/internal/zerobuspb/   # clean = bindings in sync

cd purego
go build ./...
go vet ./...
go test ./...

Code diff

Most of the code diff is generated (purego/internal files): +1005 -87

@irinatomic-db
irinatomic-db force-pushed the irina-tomic_data/avro/proto-surface branch 2 times, most recently from 70ce97a to e0d6cc5 Compare September 1, 2026 10:59
danilonajkov-db
danilonajkov-db previously approved these changes Sep 1, 2026

@danilonajkov-db danilonajkov-db left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, just check with Teodor about the CI

Signed-off-by: Irina Tomic <irina.tomic@databricks.com>
Signed-off-by: Irina Tomic <irina.tomic@databricks.com>
JSON = 2;
// 3 is ARROW_IPC on the Zerobus service.
reserved 3;
AVRO = 4;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ah, this is a preexisting issue but has only now surfaced/come to my attention. Adding this is a potential breaking change for some clients. The code that would break is not useful in any way I think, but it's still breaking, for example:

use databricks_zerobus_ingest_sdk::databricks::zerobus::RecordType;
use databricks_zerobus_ingest_sdk::StreamConfigurationOptions;
fn describe(opts: &StreamConfigurationOptions) -> &'static str {
  match opts.record_type {
    RecordType::Proto => "proto",
    RecordType::Json => "json",
    RecordType::Unspecified => "unspecified",
  }
}

After this PR this match would break. This is true also for some interactions with other generated types from this file. Due to this you had to change wrapper SDKs in this change as well.

IMO we shouldn't treat this as a regular API breaking change that requires a major version bump, but instead just note it in NEXT_CHANGELOG.md and then handle it later the proper way during a major version bump so that we don't have to think about it anymore. I've created an issue for this long term fix: [Rust] Hide generated gRPC types so additive proto changes are not crate-breaking.

Let's discuss with other folks offline as well. cc: @davidtosovic-db

Comment thread rust/sdk/zerobus_service.proto Outdated
Comment thread rust/sdk/zerobus_service.proto Outdated
Comment thread rust/sdk/zerobus_service.proto Outdated
Comment thread rust/ffi/src/stream.rs
Comment thread typescript/src/lib.rs
reserved 3 (bare); map Avro in FFI (4) and TS (2) so the not-supported path is reachable; fix descriptor/batch doc comments; regenerate purego bindings; changelog note re #822.

Signed-off-by: Irina Tomic <irina.tomic@databricks.com>
@irinatomic-db
irinatomic-db force-pushed the irina-tomic_data/avro/proto-surface branch from f55dd4c to 41b2d27 Compare September 3, 2026 15:18

@teodordelibasic-db teodordelibasic-db left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@irinatomic-db
irinatomic-db added this pull request to the merge queue Sep 3, 2026
Merged via the queue into main with commit 3f3b57b Sep 3, 2026
54 checks passed
@irinatomic-db
irinatomic-db deleted the irina-tomic_data/avro/proto-surface branch September 3, 2026 16:17
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.

3 participants