CARTO Analytics Toolbox for Databricks
June 12, 2026 · View on GitHub
The Analytics Toolbox for Databricks contains SQL functions. The functions are deployed in a schema called carto inside a specific catalog.
CARTO Analytics Toolbox for Databricks provides geospatial functionality on top of spatial SQL functions.
Tools
Make sure you have installed the following tools:
make: https://www.gnu.org/software/make/Python3: https://www.python.org/downloads/release/python-3811 (v3.8.11)virtualenv: https://virtualenv.pypa.io/en/latest/ (v20.11)
Environment variables
The .env file contains the variables required to deploy and run the toolbox.
# Databricks
DB_PREFIX=
DB_CATALOG=
DB_HOST_NAME=
DB_HTTP_PATH=
DB_TOKEN=
- Server hostname: SQL Warehouses > Connection details
- HTTP path: SQL Warehouses > Connection details
- Access token: Settings > Developer > Access tokens
Structure
commonmodulesdoc: contains the functions' documentationsql: contains the functions' SQL codetest: contains the functions' tests
Make commands
make help: shows the commands available in the Makefilemake lint: runs linters (markdownlint, sqlfluff, brunette --check, flake8, eslint) in read-only mode and fails if any issue is foundmake lint-fix: applies the auto-fixable changes (brunette, eslint --fix, markdownlint --fix, sqlfluff --fix)make build: builds the final SQL scriptmake deploy: builds and deploys the SQL scripts in the Databricks databasemake test: runs the modules tests with the Databricks database (pytest)make benchmark: runs per-function timing benchmarks. Flags:keep=1(preserve output tables for inspection),verbose=1(full error messages),tags=<tag,…>(run only cases with matching tag). Configure inputs inmodules/benchmark/config.json(copy fromconfig.template.json).make remove: removes all the SQL scripts from the Databricks databasemake clean: cleans the installed dependencies and generated files locallymake create-package: creates the installation package in the dist folder (zip)
Filtering
Commands build-modules, deploy-modules, test-modules, create-package, and benchmark-modules can be filtered by the following. All the filters are additive:
diff: list of changed filesmodules: list of modules to filterfunctions: list of functions to filter