Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dataset): use sqlglot for DML check #31024

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

betodealmeida
Copy link
Member

SUMMARY

Use sqlglot when getting column metadata for a virtual dataset. We currently use sqlglot to check for DML in SQL Lab, but when we save a query as a dataset we're still using sqlparse.

Part of SIP-117.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TESTING INSTRUCTIONS

Run this query in SQL Lab:

with source as ( select 1 as one ) select * from source

This query is flagged incorrectly as DML by sqlparse, but not by sqlglot.

After running, save the query as a dataset. It should work, but currently it fails because sqlparse flags the query as having DML.

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

@dosubot dosubot bot added the data:dataset Related to dataset configurations label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:dataset Related to dataset configurations size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant