For existing Apache Sedona users
If you already run Apache Sedona on Databricks, migrating to WherobotsDB takes two required changes, plus one optional improvement.Replace the JAR
Add your Wherobots API key
Optionally switch the Python client
wherobots-sedona provides the fullest Python support for the WherobotsDB JARs, but apache-sedona continues to work. See Install the Python client.Before you start
The following requirements must be met within both your Wherobots Organization and your Databricks workspace:Wherobots Requirements
Wherobots Requirements
- The Wherobots requirements for BYOS: an account in a Professional, Innovation, or Enterprise Edition Organization, the BYOS feature enabled on your Organization, and a Wherobots API key.
Databricks Requirements
Databricks Requirements
- A Databricks workspace with admin permissions.
- Permission to create clusters, add init scripts, and install cluster libraries.
- A supported Databricks Runtime — see Version compatibility.
- A Unity Catalog volume if you plan to use Shared access mode clusters. Init scripts and JARs for Shared clusters must live in a volume, not in the workspace file system.
- Outbound HTTPS (port 443) from the cluster to Wherobots Cloud, for license metering. A workspace with restricted egress needs Wherobots Cloud allowed; without it,
SedonaContext.createfails to authenticate. - The WherobotsDB release artifacts from Wherobots: the
sedona-dbr-spark-shaded-*JAR, thegeotools-wrapperJAR, and thewherobots_sedonaPython wheel.
Version compatibility
Choose the JAR and Python wheel that match your Databricks Runtime. Wherobots recommends Long-Term Support (LTS) runtimes for production stability.NoSuchMethodError or ClassNotFoundException.
VERSION and GEOTOOLS_VERSION are different values. For how WherobotsDB versions map to Apache Sedona and GeoTools wrapper versions, see Versions. Always use the exact filenames Wherobots delivered to you.
Install WherobotsDB on a Databricks cluster
Installing WherobotsDB involves staging its artifacts where the cluster can read them, adding an init script that copies the JARs into place at startup, and configuring the cluster to load them. Complete the sections in order.Choose a storage location
Databricks offers two places to keep the JARs and init script. Your cluster’s access mode determines which one you can use./Volumes/YOUR_CATALOG/YOUR_SCHEMA/wherobots as the example volume path. Substitute your own throughout.
Stage the JARs
- Unity Catalog volume
- Workspace files
Create the volume
CREATE VOLUME on the schema. See Create and manage volumes in the Databricks documentation.Create the jars subdirectory
Upload both JARs
Verify
Create the init script
An init script runs on every node of the cluster during startup, before Spark begins accepting work. This one copies the WherobotsDB JARs into/databricks/jars, the directory Databricks adds to the Spark classpath.
Write the script to the same place you staged the JARs in Stage the JARs. Use the tab matching that choice.
- Unity Catalog volume
- Workspace files
Write the script
cat > destination and JARS_SRC.Confirm it was written
<<'EOF' is quoted, so the shell writes the script verbatim — including a literal YOUR_CATALOG if you forget to replace it. Edit the cell before running it.Configure the cluster
Create the cluster
- A Databricks Runtime from Version compatibility.
- An access mode consistent with your storage choice — Shared requires a Unity Catalog volume.
- Either the Standard or Photon runtime engine. Both are supported.
Add the Spark configuration
Set the JDK on DBR 14.3
Attach the init script
Install the Python client
Thewherobots-sedona Python client ships as prebuilt wheels in the WherobotsDB release bundle.
The wheels contain compiled components, so there is no universal py3-none-any build. Each filename encodes a Python version tag and a platform tag, and both must match your cluster:
macosx_* and win_* wheels in the bundle. Those are for local development, not cluster nodes.
Stage the wheel alongside the JARs, using the same storage you chose in Choose a storage location. The examples below are for DBR 17.3 LTS on x86_64 workers — substitute the tags for your cluster.
- Unity Catalog volume
- Workspace files
Upload the wheel
Install it as a cluster library
%pip. Spatial functions that run on executors need the client present on every node.
apache-sedona from PyPI also works and can be installed as an ordinary PyPI library. Use the version matching your JAR’s Apache Sedona compatibility, from the table in Version compatibility. wherobots-sedona is preferred because it tracks the WherobotsDB JARs directly.Validate the installation
Start the cluster, attach a notebook to it, and run the following cells in order.Confirm the JARs were copied
Initialize Sedona
Run the validation query
spark.sql.extensions is set, ST_* functions are also available through plain spark.sql(...) and in SQL cells without calling SedonaContext.create first.Confirm geometries reach Python
Confirm spatial functions run on executors
Scala
WherobotsDB works the same way from Scala:How Wherobots authentication works
WherobotsDB validates your API key at startup against Wherobots Cloud endpoints that are part of the BYOS feature, and uses it for usage-based billing. See How Wherobots authentication works in the BYOS overview, and Create an API key if you don’t have one yet.Supply the key to the cluster
Databricks secrets are the recommended method, and the only one that keeps the key out of the cluster configuration.Store the key in a secret scope
Reference it from the Spark config
[REDACTED] in the UI.WHEROBOTS_API_KEY environment variable under Advanced options → Spark → Environment variables, which accepts the same {{secrets/...}} syntax.
If authentication fails, you will see an error when calling SedonaContext.create(spark). Confirm the key is correct and unexpired, that BYOS is enabled for your Organization, and that the cluster has outbound HTTPS to Wherobots Cloud.
Best practices
Runtime selection- Use an LTS runtime — 16.4 LTS or 17.3 LTS — for production.
- Both Standard and Photon engines are supported.
- Match the JAR’s Scala version to the runtime’s Scala version.
- For large datasets, raise
spark.driver.memoryto accommodate global index building. - Raise
spark.driver.maxResultSize— for example to2gor5g— if you hit out-of-memory errors when collecting results.
- Use Unity Catalog volumes for Shared clusters, and for anything you expect to share across clusters.
- Use workspace files only for single-user clusters.
Feature differences from Wherobots Cloud
The feature differences that apply to every BYOS deployment also apply on Databricks. On Databricks, the catalogs you point notebooks and jobs at can include Unity Catalog.Troubleshooting
ClassNotFoundException, UNRESOLVED_ROUTINE, ST_* functions not recognized, or 'JavaPackage' object is not callable in PySpark
- Confirm the JARs reached the cluster:
ls -la /databricks/jars/sedona-dbr*.jar. If they are absent, the init script did not run or could not read the source path. - Check the init script output. Databricks writes it to the cluster log destination under
init_scripts/, or to Driver logs on the cluster page. - Confirm the init script path and its source type — Volumes or Workspace — match where you actually stored it.
- On Shared access mode clusters, confirm the init script and JARs are in a Unity Catalog volume. Shared clusters cannot read them from the workspace file system.
UnsupportedClassVersionError — the cluster is running JDK 8. On DBR 14.3, set the Spark environment variable JNAME=zulu17-ca-amd64. DBR 15.0 and later use JDK 17 by default. See Version compatibility.
NoSuchMethodError at query time — a Spark or Scala mismatch between the JAR and the runtime. DBR 14.3 LTS uses Scala 2.12, DBR 16.4 LTS comes in Scala 2.12 and Scala 2.13 variants, and DBR 17.3 LTS uses Scala 2.13. See Version compatibility.
ModuleNotFoundError: No module named 'sedona' — the Python client is not installed, or was installed on the notebook rather than the cluster. Install the wheel as a cluster library so it reaches every node. If you are installing by hand, give pip the wheel’s path — wherobots-sedona by name cannot resolve, since the package ships only in the release bundle and not on PyPI.
Spatial functions work on the driver but fail inside rdd.map or a UDF — the Python client is installed on the driver only. Reinstall it as a cluster library and restart the cluster.
Authentication errors from SedonaContext.create — confirm spark.wherobots.api.key resolves. A common cause is a secret scope or key name that does not match the {{secrets/SCOPE/KEY}} reference, which leaves the property set to the literal placeholder text. Also confirm the key has not expired, that BYOS is enabled for your Organization, and that the cluster has outbound HTTPS to Wherobots Cloud.

