SQL Warehouse
Introduction
This guide contains the steps to perform a fully manual installation of the CARTO Analytics Toolbox for Databricks.
The CARTO Analytics Toolbox for Databricks is available for CARTO customers. Contact us to get an installation package.
Prerequisites
Before installing the Analytics Toolbox, ensure you have:
Unity Catalog enabled in your Databricks workspace
A SQL Warehouse provisioned in your workspace
Appropriate permissions to create catalogs, schemas and functions:
GRANT CREATE CATALOG ON METASTORE TO `<principal>`;
GRANT CREATE MANAGED STORAGE ON EXTERNAL LOCATION `<location>` TO `<principal>`;
GRANT CREATE CONNECTION ON METASTORE TO `<principal>`;Setup
This step consists of setting up the Databricks catalog and schema where the Analytics Toolbox will be installed.
Creating the catalog and schema
The Analytics Toolbox functions will be installed in a dedicated catalog and schema within your Unity Catalog. Run the following SQL in your SQL Warehouse:
AT Gateway configuration
Some functionalities of the CARTO Analytics Toolbox for Databricks require making external calls from Databricks to CARTO services. In order to make requests to these services, Databricks needs a Connection to the AT Gateway.
Connection
API Base URL and API Access Token
The Analytics Toolbox LDS functions (geocoding, isolines, routing) require credentials to connect to CARTO's Location Data Services API:
API Base URL: The address for accessing your CARTO account services, typically
https://gcp-us-east1.api.carto.comAPI Access Token: An API Access Token with LDS API permissions
To obtain these credentials:
Go to the Developers section in your CARTO workspace
Copy the API Base URL displayed there
Create a new API Access Token with LDS API enabled
Keep your API Access Token secure. Anyone with access to this token can use the LDS quota assigned to your account.
Installation
Download the installation package
The Analytics Toolbox installation package contains SQL scripts to create the functions in your Unity Catalog schema.
This package will contain:
LICENSE file
modules.sql file
Create the functions and procedures
Extract the installation package
Open the
modules.sqlfile in your Databricks SQL editorUpdate the catalog and schema names if different from the defaults
Execute the script against your SQL Warehouse
The script will create all Analytics Toolbox functions in the specified schema.
Running the installation script will replace any existing functions with the same names in the target schema.
Setup AT Gateway variables
After running the installation script, configure the AT Gateway credentials by calling the SETUP procedure:
This step stores your credentials so that LDS functions can use them. You can pass NULL for the credentials in subsequent LDS function calls to use these stored defaults.
Verification
After installation and configuration, verify that everything is working correctly by checking your LDS quota:
You should receive a JSON response showing your available quota and configured providers:
This confirms that:
The Analytics Toolbox is installed correctly
Your credentials are valid
The LDS service is working
Congratulations!
You have successfully installed the CARTO Analytics Toolbox for Databricks. Now you can start using the SQL functions available in the SQL Reference.
Next steps
Check the SQL Reference for the complete list of available functions
Learn about LDS functions for geocoding, routing, and isoline generation
Last updated
Was this helpful?
