Skip to content

anhhchu/databricks-dotnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Databricks .NET Integration Examples

This project demonstrates how to connect to Databricks from .NET applications using two different approaches:

  1. ODBC Connection - Using the Simba Spark ODBC Driver
  2. REST API Connection - Using Databricks SQL Statement Execution API

Project Structure

dotnet_databricks/
β”œβ”€β”€ odbc/                    # ODBC connection example
β”‚   β”œβ”€β”€ OdbcDatabricks.cs   # Main ODBC implementation
β”‚   β”œβ”€β”€ README.md           # Detailed ODBC setup instructions
β”‚   └── dotnet_databricks.csproj
β”œβ”€β”€ restapi/                # REST API connection example
β”‚   β”œβ”€β”€ RestapiDatabricks.cs # Main REST API implementation
β”‚   β”œβ”€β”€ README.md           # Detailed REST API setup instructions
β”‚   └── dotnet_databricks.csproj
└── README.md               # This file

Prerequisites

  • .NET 9.0 SDK
  • A Databricks workspace
  • Databricks personal access token
  • For ODBC: Simba Spark ODBC Driver (see odbc/README.md for installation instructions)

What Each Example Does

Both examples execute a sample query against the Databricks samples.tpch.orders table (available in most Databricks workspaces) and retrieve the results:

  • REST API: Prints results to console
  • ODBC: Writes results to query_results.txt file

Documentation

Security Notes

  • Use environment variables or secure configuration management in production
  • Rotate your Databricks personal access tokens regularly

License

This project is provided as example code for educational purposes.

About

Simple examples to use dotnet with databricks DBSQL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages