Skip to content

[.NET] Add Databricks Zerobus Ingest SDK for .NET - #535

Closed
zlata-stefanovic-db wants to merge 5 commits into
mainfrom
contrib/dotnet-sdk-532
Closed

[.NET] Add Databricks Zerobus Ingest SDK for .NET#535
zlata-stefanovic-db wants to merge 5 commits into
mainfrom
contrib/dotnet-sdk-532

Conversation

@zlata-stefanovic-db

Copy link
Copy Markdown
Contributor

Supersedes #532 by @nalyd2, re-branched into the main repo so CI can run (our workflow blocks CI on fork PRs). Original author's commits and sign-offs are preserved via rebase.

Co-authored-by: efrain robles jazer_252_@hotmail.com

nalyd2 added 3 commits July 20, 2026 08:44
Initial implementation of the .NET SDK wrapping the Rust C FFI (rust/ffi/) via P/Invoke.

- JSON, Protocol Buffers, and Arrow Flight ingestion streams
- Fluent StreamBuilder API with typed sub-builders
- Thread-safe streams with ReaderWriterLockSlim
- IAsyncDisposable support (.NET 8+)
- HeadersProviderBridge for custom authentication callbacks
- ProtoSchema for Unity Catalog schema generation
- Integration tests with real gRPC mock server (zerobus_service.proto)
- 51 tests: 30 unit + 21 integration (4 self-test, 4 smoke, 17 end-to-end)
- CI/CD workflows integrated into push.yml and release-dotnet.yml
- Cross-platform NuGet package (win-x64, linux-x64, linux-arm64, osx-x64, osx-arm64)

Signed-off-by: Efrain Robles Gonzalez <efrain.robles@serviciosexternos.com.mx>
Set RecordType in native options struct (1=Proto, 2=Json) so stream
creation stops rejecting JSON/Proto streams with 'Record type is not
specified'. Also rework integration tests to avoid IAsyncLifetime,
which triggers a .NET 8.0.28 JIT bug causing InvalidProgramException
when combined with DllImport.

Signed-off-by: Efrain Robles Gonzalez <efrain.robles@serviciosexternos.com.mx>
Three discrepancies found by comparing C# hardcoded defaults against
zerobus_get_default_config() / zerobus_arrow_get_default_config():

1. CallbackMaxWaitTimeMs was null (wait forever), native default is 5000ms
2. MaxInflightBatches was 10000, native default is 1000
3. Arrow StreamPausedMaxWaitTimeMs was ulong (0), native expects int64_t
   with -1 meaning 'wait full server duration'

Also adds Defaults_MatchNativeConfig and ArrowDefaults_MatchNativeConfig
smoke tests to detect future drift.

Signed-off-by: Efrain Robles Gonzalez <efrain.robles@serviciosexternos.com.mx>
@zlata-stefanovic-db
zlata-stefanovic-db marked this pull request as draft July 20, 2026 08:46
The pinned actions/setup-dotnet SHA did not exist, causing every .NET
CI job to fail at setup before running. Pin to the real v5 (v5.4.0) SHA.

Signed-off-by: Zlata Stefanovic <zlata.stefanovic@databricks.com>
actions/upload-artifact and actions/download-artifact were pinned to
nonexistent commit SHAs, failing the .NET Test jobs at setup. Pin both
to the real v4 SHAs.

Signed-off-by: Zlata Stefanovic <zlata.stefanovic@databricks.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.

2 participants