Skip to content

Add native ADBC FlightSQL driver support for osx-arm64, fix ADBC resources disposal - #16

Merged
ewgenius merged 6 commits into
trunkfrom
evgenii/2026-01-08/fixadbc-client-macos-arm
Jan 8, 2026
Merged

Add native ADBC FlightSQL driver support for osx-arm64, fix ADBC resources disposal#16
ewgenius merged 6 commits into
trunkfrom
evgenii/2026-01-08/fixadbc-client-macos-arm

Conversation

@ewgenius

@ewgenius ewgenius commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

🗣 Description

This pull request updates the Spice ADBC FlightSQL client to support direct loading of platform-specific native drivers, improves resource management for query execution, and enhances test coverage and correctness. The most significant changes are the introduction of dynamic native driver resolution, improved statement disposal, and test updates for more robust integration.

Native driver loading and platform support:

  • Added logic in SpiceAdbcClient.cs to resolve and load the correct native ADBC FlightSQL driver at runtime based on the current OS and architecture, supporting platforms such as osx-arm64 that are not covered by the upstream NuGet package. This includes new helper methods for runtime identifier and driver filename resolution, and a corresponding update to Spice.csproj to include native binaries in the NuGet package. [1] [2]

Resource management improvements:

  • Introduced the new StatementBoundArrowArrayStream class to ensure that ADBC statements are kept alive for the lifetime of the result stream and disposed in the correct order, preventing premature resource release and potential errors during streaming. [1] [2] [3]

Connection URI handling:

  • Updated URI scheme handling in SpiceAdbcClient.cs to automatically translate http/https URIs to the appropriate grpc/grpc+tls schemes expected by the native driver, improving compatibility and usability.

Test improvements:

  • Updated integration tests in ParameterizedQueryIntegrationTest.cs to use fully qualified table names (e.g., spice.tpch.customer) and to properly dispose of result streams with using, ensuring correctness and resource cleanup. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

Minor cleanup:

  • Removed unused interop driver imports and updated comments for clarity in SpiceAdbcClient.cs. [1] [2]

@ewgenius ewgenius self-assigned this Jan 8, 2026
@ewgenius
ewgenius marked this pull request as ready for review January 8, 2026 01:07
@ewgenius
ewgenius requested a review from Copilot January 8, 2026 01:07

Copilot AI 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.

Pull request overview

This pull request adds native ADBC FlightSQL driver support for all platforms, removing the dependency on the Go-based driver interop. The changes enable direct loading of native drivers and include special handling for macOS ARM64 which downloads the driver at build time if not available in the upstream NuGet package.

Key changes:

  • Direct native driver loading using AdbcDriverLoader with platform-specific path resolution
  • Build-time download mechanism for osx-arm64 native driver via MSBuild targets
  • Updated URI scheme handling to convert http/https to grpc/grpc+tls schemes

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
Spice/src/Adbc/SpiceAdbcClient.cs Replaced Go-based FlightSQL driver with native driver loading, added platform-specific path resolution methods, and updated URI scheme conversion logic
Spice/build/SpiceAI.targets New MSBuild targets file that downloads and extracts osx-arm64 driver from Python wheel at build time
Spice/Spice.csproj Added SpiceAI.targets to package and imported it for local development
.github/workflows/pr.yaml Removed continue-on-error flag for macOS tests, indicating native driver support is now working

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Spice/src/Adbc/SpiceAdbcClient.cs
Comment thread Spice/build/SpiceAI.targets Outdated
Comment thread Spice/build/SpiceAI.targets Outdated
Comment thread Spice/build/SpiceAI.targets Outdated
Comment thread Spice/build/SpiceAI.targets Outdated
Comment thread Spice/build/SpiceAI.targets Outdated
Comment thread Spice/build/SpiceAI.targets Outdated
@ewgenius ewgenius added the bug Something isn't working label Jan 8, 2026
@ewgenius
ewgenius marked this pull request as draft January 8, 2026 01:30
Include platform-specific driver loading logic and update tests to use
explicit FlightSQL endpoints.
@ewgenius
ewgenius force-pushed the evgenii/2026-01-08/fixadbc-client-macos-arm branch from 249cbe7 to 1571493 Compare January 8, 2026 02:12
- Wrap query result streams to ensure the underlying ADBC statement
  remains alive for the stream's lifetime and is disposed correctly.
- Update integration tests to use 'using' for result streams.
- Add StatementBoundArrowArrayStream to manage disposal order.
@ewgenius
ewgenius force-pushed the evgenii/2026-01-08/fixadbc-client-macos-arm branch from 8920139 to f723f01 Compare January 8, 2026 03:23
@ewgenius
ewgenius marked this pull request as ready for review January 8, 2026 03:27
@ewgenius
ewgenius requested a review from Copilot January 8, 2026 03:27

Copilot AI 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.

Pull request overview

Copilot reviewed 5 out of 7 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Spice/Spice.csproj
Comment thread Spice/src/Adbc/SpiceAdbcClient.cs
Comment thread Spice/src/Adbc/StatementBoundArrowArrayStream.cs Outdated
Comment thread Spice/src/Adbc/StatementBoundArrowArrayStream.cs
@ewgenius ewgenius changed the title Add native ADBC FlightSQL driver support for all platforms Add native ADBC FlightSQL driver support for all platforms, fix ADBC resources disposal Jan 8, 2026
@ewgenius ewgenius changed the title Add native ADBC FlightSQL driver support for all platforms, fix ADBC resources disposal Add native ADBC FlightSQL driver support for osx-arm64, fix ADBC resources disposal Jan 8, 2026
@ewgenius
ewgenius requested a review from lukekim January 8, 2026 03:59
@ewgenius
ewgenius merged commit 5fc6e77 into trunk Jan 8, 2026
24 of 25 checks passed
@ewgenius
ewgenius deleted the evgenii/2026-01-08/fixadbc-client-macos-arm branch January 8, 2026 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants