Skip to content

fix(csharp): extract spog org id from cluster path#502

Open
msrathore-db wants to merge 1 commit into
mainfrom
fix-spog-org-id-extract-cluster-path
Open

fix(csharp): extract spog org id from cluster path#502
msrathore-db wants to merge 1 commit into
mainfrom
fix-spog-org-id-extract-cluster-path

Conversation

@msrathore-db
Copy link
Copy Markdown
Collaborator

Summary

  • Fixes silent workspace-context loss on SPOG/custom-URL hosts when the C# Databricks driver connects with an all-purpose-compute HiveServer2 path like sql/protocolv1/o/<workspace-id>/<cluster-id>.
  • PropertyHelper.ParseOrgIdFromProperties now extracts the workspace ID from the /o/<wsid>/ path segment as a fallback when ?o=<wsid> is not present.
  • Priority order matches the JDBC/Python/Go fixes: ?o= query parameter wins, then /sql/protocolv1/o/<wsid>/<cluster-id> path segment.

Why

For all-purpose cluster Thrift paths on SPOG, PoPP can route the Thrift request from the /o/<workspace-id>/ path segment. Other HTTP requests built from the same connection, including SEA/telemetry-style requests, do not naturally carry that path context. Without the x-databricks-org-id header they can be routed without workspace context and redirected to /login.

What changes

  • Adds a compiled cluster-path regex matching (?:^|/)sql/protocolv1/o/(\d+)/[^/?]+.
  • Applies the fallback to both SparkParameters.Path and AdbcOptions.Uri inputs.
  • Adds unit coverage for cluster path extraction, leading slash, ?o= precedence, warehouse-path non-match, and URI path extraction.

Test plan

  • dotnet test csharp/test/AdbcDrivers.Databricks.Tests.csproj --filter FullyQualifiedName~PropertyHelperTests
  • dotnet build csharp/src/AdbcDrivers.Databricks.csproj
  • Same SPOG cluster behavior has been live-tested on sibling JDBC/Python/Go fixes against peco.azuredatabricks.net all-purpose cluster path.

This pull request and its description were written with assistance from Claude Code.

Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
@msrathore-db msrathore-db changed the title Extract SPOG org-id from cluster path for C# SEA requests fix(csharp): extract spog org id from cluster path May 31, 2026
@msrathore-db msrathore-db added this pull request to the merge queue Jun 2, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 2, 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.

2 participants