Connecting to Databricks

Description

Connect Alpha Anywhere to Databricks using the Databricks ODBC driver. This page shows how to configure the connection string and set the catalog context so queries from components (e.g. Grid, UX) work as expected.

Overview

Alpha Anywhere does not include a native Databricks driver. Use an ODBC connection with the Databricks ODBC driver, then set an initial command so the correct catalog is in context for queries.

Prerequisites

Install the Databricks ODBC driver on the development machine and any application server that will connect to Databricks.

https://www.databricks.com/spark/odbc-driver

Create the AlphaDAO Connection (ODBC)

(1) In the Web Project Control Panel, create a new AlphaDAO Connection String.

(2) Choose ODBC as the API/vendor.

(3) Select the Databricks ODBC driver and fill in required fields (Host, HTTP Path, Personal Access Token) per your Databricks workspace.

(4) Open the Advanced/Additional settings to find the Initial Command property.

(5) Set the initial command to choose your Databricks catalog. For example:

With the catalog set, two-part names like bakehouse.sales_customers will resolve correctly from Alpha Anywhere components.

USE CATALOG samples
Initial Command in the connection string dialog
Initial Command in the connection string dialog

Using the Connection

After setting the catalog with the initial command, queries can use two-part names:

In Xbasic, open the connection string and execute SQL as usual.

SELECT *
FROM bakehouse.sales_customers
LIMIT 25

Troubleshooting name resolution

If queries fail with “catalog unknown” errors, verify the Initial Command was set in the connection and the value is a valid catalog in your workspace.

If you use a different catalog, update the command accordingly (e.g. USE CATALOG prod).

Related topics

https://documentation.alphasoftware.com/documentation/pages/Guides/Databases/Connecting/Connecting%20to%20MariaDB.xml

https://documentation.alphasoftware.com/documentation/pages/Guides/Databases/Connecting/Create%20SQL%20Connection%20String%20Dialog.xml

Databricks supports three-part names (catalog.schema.table). Alpha components typically emit two-part names (database.schema or schema.table depending on driver). Setting the catalog via Initial Command aligns Alpha’s generated SQL with Databricks’ catalog requirement.

See Also