Skip to content

Add databricks-sql (Databricks SQL for RustGIS) - #104

Merged
giswqs merged 2 commits into
opengeos:mainfrom
garridolecca:add-databricks-sql
Dec 1, 2026
Merged

giswqs merged 2 commits into
opengeos:mainfrom
garridolecca:add-databricks-sql

Conversation

@garridolecca

Copy link
Copy Markdown
Contributor

Plugin: Databricks SQL (garridolecca/rustgis-databricks), a Python session process plugin, Apache-2.0.

What it does: It adds a Databricks panel to RustGIS:

  • Sign in with a Databricks CLI profile and a SQL warehouse.
  • Browse Unity Catalog for GEOMETRY / GEOGRAPHY tables, and add them once or as dynamic layers. A dynamic layer re-queries only the map's view as you pan and zoom, into a GeoPackage RustGIS reloads in place, so styling survives.
  • Run any SELECT as a layer.
  • Ask Genie (Databricks' natural-language SQL) in plain English. The result is mapped, styled and zoomed to. The Genie controls are greyed out for accounts without Genie.

The plugin never stores a token: it signs in through the Databricks SDK with the user's CLI profile.

How I tested it: RustGIS 0.8.0 on macOS (arm64), in the desktop app and rustgis-cli, against a Databricks SQL warehouse:

  • connect, browse, add (whole table, current view, a drawn box);
  • SQL layers;
  • dynamic layers on 1.2k points and 127k road segments (refreshes 0.3–1.7 s);
  • Genie questions mapped as points and H3 cells;
  • a no-Genie account;
  • installing the packaged .rgplugin into a clean plugins folder.

The panel uses two tab rows ("kind": "tabs"), which build.py doesn't accept yet, so this depends on #103. With #103 applied, python scripts/build.py --check passes.

  • The entry's source.url is a release asset of the plugin's repository, and sha256 is that file's (checked against the downloaded v0.4.0 asset).
  • The plugin asks only for the permissions it uses:
    • edit, to add and reload layers;
    • network, for Databricks;
    • files, for the local GeoPackages behind dynamic layers.

This pull request and its description were written by Isaac.

Co-authored-by: Isaac <no-reply@databricks.com>
@garridolecca
garridolecca requested a review from giswqs as a code owner December 1, 2026 23:24
@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 32 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: fabe2e34-f263-4afa-be1b-5ba7ed0e948d
Commits

Reviewing files that changed from the base of the PR and between b0d79ae and 0b4aedb.

Files selected for processing: 1

  • registry/databricks-sql.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@giswqs giswqs added the claude-review Ask the Claude Code review to review this pull request label Dec 1, 2026
{
"id": "databricks-sql",
"source": {
"url": "https://github.com/garridolecca/rustgis-databricks/releases/download/v0.4.0/databricks-sql-0.4.0.rgplugin",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a non-sandboxed process plugin whose network permission is the plugin's own, not enforced by RustGIS. The package is pinned by SHA-256, which is good. requirements.txt is unpinned (databricks-sql-connector[pyarrow]>=4.0, databricks-sdk>=0.50), so what gets installed from PyPI can change after review. I'd ask the author to pin exact versions. Confidence: medium.

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

Code review

Bugs

  • sql-layer only checks that the text starts with select or with (main.py:1043). Statements such as WITH … INSERT or multi-statement text are not blocked by the plugin. The warehouse and the user's Databricks permissions are the real guard. Confidence: low.
  • The cache directory rustgis-databricks in the temp folder gets a new .gpkg for every dynamic layer. Nothing deletes them on stop or exit. Confidence: medium (minor disk leak).

Security

  • This is a process plugin, so it is not sandboxed. It runs with the user's full rights, and network and files are not enforced as limits on it. I read main.py (1,170 lines). I found no subprocess, os.system, eval/exec, obfuscated code, or direct HTTP or socket use. It does no home-folder or credential file reads of its own. Authentication goes through the Databricks SDK with the user's CLI profile (Config(profile=…)), which reads ~/.databrickscfg by design.
  • The files it writes are GeoPackages under the temp folder, with sanitised names plus a random suffix. This matches the declared files use.
  • Table names are backtick-quoted. The SQL layer and Genie features run user-supplied SQL by design.
  • ask-genie creates a Genie space in the user's workspace (w.genie.create_space) as a side effect. The description does not mention it clearly. It is cached in settings. Confidence: medium. Worth asking the author to document it.
  • requirements.txt is unpinned (>=4.0, >=0.50). The packages are well known and not typosquats, with no URL or VCS requirements. Pinning is preferred (inline comment). Confidence: medium.

Performance

  • Nothing blocking. Queries use LIMIT (default 50,000) and are filtered to the view.

Quality

  • Manifest id, name, version and permissions are consistent with the entry. The registry entry has id, source (URL and SHA-256) and categories, as expected.
  • The PR says it depends on Registry checks: accept tab rows ("tabs") in panels #103 (the tabs kind in build.py). Merge order matters, because build.py --check fails without it.

CLAUDE.md

  • No violations found. The PR adds only a registry entry, with no plugin source in the repository.

Plugin packages

id version runtime package module permissions module imports commands named in strings
databricks-sql 0.4.0 process (not sandboxed), Python 3.12 29,242 B 5 files edit, network, files runs ["python", "main.py"] n/a: read its code

Assessment:

  • The package was inspected, and its hash was verified by the trusted step.
  • The code matches its stated purpose, and no binaries are included.
  • homepage points to the source repository.
  • Remaining items are the unpinned requirements, the Genie space creation, and the unremoved temp files.

Change size

Compared: the whole PR against main (merge base a7ec9d9 to PR head 71ce6c3).

Metric Value
Files changed 1 (1 added, 0 modified, 0 removed, 0 renamed)
Size before 0 B
Size after 297 B
Total size change +297 B
File Before After Change
registry/databricks-sql.json 0 B 297 B +297 B

"id": "databricks-sql",
"source": {
"url": "https://github.com/garridolecca/rustgis-databricks/releases/download/v0.4.0/databricks-sql-0.4.0.rgplugin",
"sha256": "1c610014750808b1326ee53d1f3902b6cf6a15638b3252b0ddd7f97355948e9e"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a process plugin (unsandboxed Python with the user's full rights). I read all of main.py (1,170 lines) from the unpacked package. I found no subprocess, eval/exec, obfuscation, environment or home-folder reads, or direct network code. Network access goes only through databricks-sql-connector and databricks-sdk, using the user's CLI profile.

Points for a maintainer to weigh (low to medium confidence):

  • requirements.txt is unpinned (databricks-sql-connector[pyarrow]>=4.0, databricks-sdk>=0.50). Both are well-known packages, but each install resolves to whatever is newest on PyPI. Pinning exact versions (or using a lock) would make the reviewed package match what runs.
  • The files permission is used to write GeoPackages to tempfile.gettempdir()/rustgis-databricks/. The folder is shared and predictable, and nothing is cleaned up, so large result sets pile up in /tmp.
  • Genie can create a Databricks Genie space as a side effect (Created Genie space 'RustGIS · …'). Beyond reading data, the plugin changes the user's workspace. This should be stated in the description and README.
  • sql-layer accepts anything starting with select or with. The statement is wrapped as (…) in a subquery, which limits abuse. Genie-generated SQL is wrapped the same way but not checked for SELECT.

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

Code review

Bugs

Security

  • The plugin is a process plugin, so it is unsandboxed. I read all of main.py and found no subprocess, eval/exec, obfuscated code, environment or home-folder reads, or direct sockets. Its network access goes through the Databricks SDK and connector using the user's CLI profile. Confidence: medium-high.
  • requirements.txt is unpinned (>=4.0, >=50). The packages are well known, but installs aren't reproducible. Confidence: medium.
  • Genie can create a Genie space in the user's workspace. The description doesn't mention this side effect. Confidence: medium.
  • sql-layer only checks that the text starts with select or with. The SQL is wrapped in a subquery, which limits abuse. Genie SQL is not checked at all. Confidence: low.

Performance

  • GeoPackages in the shared /tmp/rustgis-databricks are never cleaned up. Confidence: low-medium.

Quality

  • Nothing to report on the entry. The homepage points to the source repo.

CLAUDE.md

  • No CLAUDE.md guidelines apply to this change. The PR adds only a registry entry, so it is in scope.

Plugin packages

id version runtime package module permissions module imports commands named in strings
databricks-sql 0.4.0 process (not sandboxed), Python 3.12 29,242 B 5 files edit, network, files runs ["python", "main.py"] n/a: read its code

Assessment: the code matches the stated purpose, and the edit, network and files permissions are justified. The manifest id, name and version match the entry. There are no binaries in the package. The concerns above (unpinned requirements, the Genie space side effect, temp-file cleanup) are for a maintainer to weigh before merging.

Change size

Compared: the whole PR against main (merge base b0d79ae to PR head 0b4aedb).

Metric Value
Files changed 1 (1 added, 0 modified, 0 removed, 0 renamed)
Size before 0 B
Size after 297 B
Total size change +297 B
File Before After Change
registry/databricks-sql.json 0 B 297 B +297 B

@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

🧩 Plugin preview

Removed: the pull request is closed.

@giswqs
giswqs merged commit 44a5a7f into opengeos:main Dec 1, 2026
6 checks passed
@garridolecca garridolecca mentioned this pull request Dec 2, 2026
2 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude-review Ask the Claude Code review to review this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants