-
Create a Databricks account or be able to log in to an existing one.
-
Log into Databricks and create or locate an existing SQL warehouse.
-
Open the "Connection details" tab and record the server hostname and HTTP path. See the Databricks documentation describing how to get these connection details.
-
Install the Databricks ADBC driver:
dbc install --level user databricks
-
Customize the C++ program
main.cpp:- Change the connection arguments in the
AdbcDatabaseSetOption()calls:uriis the URI for your Databricks instance. The program includes several authentication options. See the Databricks ADBC driver documentation for details.
- Change the SQL SELECT statement in
AdbcStatementSetSqlQuery(), or keep it as is.- Specify the catalog and schema by fully qualifying the table name as
catalog.schema.table.
- Specify the catalog and schema by fully qualifying the table name as
- Change the connection arguments in the
-
Build and run the C++ program:
Using Make:
pixi run make ./databricks_demo
Or using CMake:
pixi run cmake -B build pixi run cmake --build build ./build/databricks_demo
-
Clean build artifacts:
Using Make:
pixi run make clean
Using CMake:
rm -rf build