Skip to content

feat(sqlglot): Vertica dialect#39969

Merged
Vitor-Avila merged 2 commits into
masterfrom
vertica-dialect
May 8, 2026
Merged

feat(sqlglot): Vertica dialect#39969
Vitor-Avila merged 2 commits into
masterfrom
vertica-dialect

Conversation

@betodealmeida
Copy link
Copy Markdown
Member

SUMMARY

Vertica currently uses the Postgres dialect, since it's based on its wire protocol. But some functions end up being translated incorrectly when we apply RLS and go through a cycle of parsing/modifying/rendering. For example:

>>> from superset.sql.dialects.vertica import Vertica
>>> from sqlglot import parse_one
>>> parse_one("SELECT LAST_DAY(DATE('2026-01-15'))").sql()
"SELECT LAST_DAY(DATE('2026-01-15'))"
>>> parse_one("SELECT LAST_DAY(DATE('2026-01-15'))", "postgres").sql("postgres")
"SELECT CAST(DATE_TRUNC('MONTH', DATE('2026-01-15')) + INTERVAL '1 MONTH' - INTERVAL '1 DAY' AS DATE)"
>>> parse_one("SELECT LAST_DAY(DATE('2026-01-15'))", Vertica).sql(Vertica)
"SELECT LAST_DAY(DATE('2026-01-15'))"

This PR introduces a Vertica dialect, with support for functions that behave differently from Postgres.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented May 8, 2026

Code Review Agent Run #cad16d

Actionable Suggestions - 0
Review Details
  • Files reviewed - 4 · Commit Range: 1305b74..1305b74
    • superset/sql/dialects/__init__.py
    • superset/sql/dialects/vertica.py
    • superset/sql/parse.py
    • tests/unit_tests/sql/dialects/vertica_tests.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@dosubot dosubot Bot added the data:connect:vertica Related to Vertica label May 8, 2026
@betodealmeida betodealmeida requested a review from Vitor-Avila May 8, 2026 16:06
@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

❌ Patch coverage is 94.73684% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 63.88%. Comparing base (aa71067) to head (e1f365c).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
superset/sql/dialects/vertica.py 93.75% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #39969   +/-   ##
=======================================
  Coverage   63.88%   63.88%           
=======================================
  Files        2583     2584    +1     
  Lines      136618   136635   +17     
  Branches    31502    31502           
=======================================
+ Hits        87272    87288   +16     
- Misses      47830    47831    +1     
  Partials     1516     1516           
Flag Coverage Δ
hive 39.38% <94.73%> (+0.01%) ⬆️
mysql 59.05% <94.73%> (+<0.01%) ⬆️
postgres 59.12% <94.73%> (+<0.01%) ⬆️
presto 41.08% <94.73%> (+0.01%) ⬆️
python 60.56% <94.73%> (+<0.01%) ⬆️
sqlite 58.76% <94.73%> (+<0.01%) ⬆️
unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@Vitor-Avila Vitor-Avila left a comment

Choose a reason for hiding this comment

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

Approved! Thank you so much

@Vitor-Avila Vitor-Avila merged commit 4311a15 into master May 8, 2026
65 checks passed
@Vitor-Avila Vitor-Avila deleted the vertica-dialect branch May 8, 2026 17:34
@bito-code-review
Copy link
Copy Markdown
Contributor

Bito Automatic Review Skipped – PR Already Merged

Bito scheduled an automatic review for this pull request, but the review was skipped because this PR was merged before the review could be run.
No action is needed if you didn't intend to review it. To get a review, you can type /review in a comment and save it

qfcwell pushed a commit to qfcwell/superset that referenced this pull request May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants