SoftSense.Databricks.Core 0.0.1-prerelease19-786528c

This is a prerelease version of SoftSense.Databricks.Core.
dotnet add package SoftSense.Databricks.Core --version 0.0.1-prerelease19-786528c
                    
NuGet\Install-Package SoftSense.Databricks.Core -Version 0.0.1-prerelease19-786528c
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SoftSense.Databricks.Core" Version="0.0.1-prerelease19-786528c" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SoftSense.Databricks.Core" Version="0.0.1-prerelease19-786528c" />
                    
Directory.Packages.props
<PackageReference Include="SoftSense.Databricks.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SoftSense.Databricks.Core --version 0.0.1-prerelease19-786528c
                    
#r "nuget: SoftSense.Databricks.Core, 0.0.1-prerelease19-786528c"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SoftSense.Databricks.Core@0.0.1-prerelease19-786528c
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SoftSense.Databricks.Core&version=0.0.1-prerelease19-786528c&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=SoftSense.Databricks.Core&version=0.0.1-prerelease19-786528c&prerelease
                    
Install as a Cake Tool

Databricks Client SDK

High-performance .NET SDK for Databricks SQL Warehouse.

.NET Build and Publish License

Features

  • Execute SQL queries against Databricks SQL Warehouses
  • Stream large result sets efficiently
  • Azure Entra ID and PAT authentication
  • Async/await support
  • Automatic retry with exponential backoff
  • AOT-compatible

Installation

dotnet add package SoftSense.Databricks.Core
dotnet add package SoftSense.Databricks.SqlClient

Quick Start

C#

using Azure.Identity;
using SoftSense.Databricks.Core.Configuration;
using SoftSense.Databricks.SqlClient;

var config = new DatabricksConfig
{
    WorkspaceUrl = "https://adb-123456789.azuredatabricks.net",
    Credential = new DefaultAzureCredential(),
    WarehouseId = "your-warehouse-id"
};

using var client = new SqlWarehouseClient(config);

// Execute query
var result = await client.ExecuteQueryAsync("SELECT * FROM table");

// Stream large results
await foreach (var row in client.ExecuteQueryStreamAsync("SELECT * FROM large_table"))
{
    ProcessRow(row);
}

Authentication

var config = new DatabricksConfig
{
    WorkspaceUrl = "https://adb-123456789.azuredatabricks.net",
    Credential = new DefaultAzureCredential()
};

Personal Access Token

var config = new DatabricksConfig
{
    WorkspaceUrl = "https://your-workspace.databricks.com",
    AccessToken = Environment.GetEnvironmentVariable("DatabricksConfig__AccessToken")
};

Environment Variables

Configuration can be loaded from environment variables using .NET configuration notation:

# Windows
set DatabricksConfig__WorkspaceUrl=https://your-workspace.databricks.com
set DatabricksConfig__WarehouseId=your-warehouse-id
set DatabricksConfig__AccessToken=your-token

# Linux/macOS
export DatabricksConfig__WorkspaceUrl=https://your-workspace.databricks.com
export DatabricksConfig__WarehouseId=your-warehouse-id
export DatabricksConfig__AccessToken=your-token

Then load with configuration builder:

using Microsoft.Extensions.Configuration;
using SoftSense.Databricks.Core.Configuration;

var configuration = new ConfigurationBuilder()
    .AddEnvironmentVariables()
    .Build();

var config = configuration.GetSection("DatabricksConfig").Get<DatabricksConfig>();

Configuration

Option Type Default Description
WorkspaceUrl string Required Databricks workspace URL
WarehouseId string Optional Default warehouse ID
Credential TokenCredential null Azure Entra ID credential
AccessToken string null Personal Access Token
TimeoutSeconds int 300 HTTP request timeout
MaxRetries int 3 Max retry attempts

Note: Either Credential or AccessToken is required.

Error Handling

using SoftSense.Databricks.Core.Exceptions;

try
{
    var result = await client.ExecuteQueryAsync(sql);
}
catch (DatabricksAuthenticationException ex)
{
    Console.WriteLine($"Auth failed: {ex.Message}");
}
catch (DatabricksRateLimitException ex)
{
    Console.WriteLine($"Rate limited. Retry after: {ex.RetryAfter}");
}
catch (DatabricksHttpException ex)
{
    Console.WriteLine($"HTTP {ex.StatusCode}: {ex.Message}");
}

Building from Source

cd source/csharp
dotnet restore
dotnet build
dotnet test

Benchmarks

Performance benchmarks comparing batched vs streamed query execution are available in source/csharp/SoftSense.Databricks.Benchmarks.

cd source/csharp/SoftSense.Databricks.Benchmarks
dotnet run -c Release

See benchmark documentation for details.

License

Apache License 2.0 - see LICENSE file.

Support

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on SoftSense.Databricks.Core:

Package Downloads
SoftSense.Databricks.SqlClient

SQL Warehouse client for Databricks providing synchronous and streaming query execution with support for batched and chunked result retrieval, catalog and schema management.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.1-prerelease19-786528c 391 11/19/2025