Skip to content

Handle DROP VIEW cleanup and robust SQL parser spans#21

Merged
nicosuave merged 2 commits intomainfrom
nicosuave/open-pr-fixes
Feb 21, 2026
Merged

Handle DROP VIEW cleanup and robust SQL parser spans#21
nicosuave merged 2 commits intomainfrom
nicosuave/open-pr-fixes

Conversation

@nicosuave
Copy link
Member

@nicosuave nicosuave commented Feb 21, 2026

Summary

  • add DROP VIEW lifecycle handling to measure-view catalog through FFI and extension hook
  • harden SQL parsing in measures engine for quoted and qualified identifiers, alias parsing, and comment-aware whitespace handling
  • replace parser span estimates with source-aware scanners for AGGREGATE calls and SELECT item ranges, including comment handling
  • add regression tests for malformed DROP VIEW tails and comment-heavy span and alias cases

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 18f928eaed

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +723 to +727
let end = parse_qualified_name_span(sql, idx)?;
if !is_statement_tail(sql, end) {
return None;
}
extract_last_qualified_identifier(&sql[idx..end])

Choose a reason for hiding this comment

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

P2 Badge Preserve schema when dropping measure views

This parser drops schema qualification by returning only the last identifier from DROP VIEW names, so DROP VIEW analytics.orders_v is treated the same as DROP VIEW orders_v. Because the catalog delete is keyed only by that unqualified name, a drop against a different schema can remove the wrong measure metadata and break subsequent AGGREGATE(...) queries for the still-existing view. Keep the full qualified name (or reject qualified drops) when mapping DROP statements to measure-view cleanup.

Useful? React with 👍 / 👎.

@nicosuave nicosuave merged commit 0aa5aec into main Feb 21, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant