Closed betodealmeida closed 3 hours ago
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.
sqlglot
sqlparse
Part of SIP-117.
N/A
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.
SUMMARY
Use
sqlglot
when getting column metadata for a virtual dataset. We currently usesqlglot
to check for DML in SQL Lab, but when we save a query as a dataset we're still usingsqlparse
.Part of SIP-117.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TESTING INSTRUCTIONS
Run this query in SQL Lab:
This query is flagged incorrectly as DML by
sqlparse
, but not bysqlglot
.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