Skip to content

fix: add row_number and snapshots to Dremio reserved keywords list#955

Merged
haritamar merged 1 commit intomasterfrom
devin/1772501597-add-dremio-reserved-keywords
Mar 3, 2026
Merged

fix: add row_number and snapshots to Dremio reserved keywords list#955
haritamar merged 1 commit intomasterfrom
devin/1772501597-add-dremio-reserved-keywords

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Mar 3, 2026

Summary

Adds row_number and snapshots to the Dremio reserved keywords list in escape_reserved_keywords.sql. Both are reserved in Dremio's Calcite SQL parser and cause parse errors when used as unquoted column aliases or identifiers.

Discovered while working on elementary CLI Dremio support (elementary#2135), where edr monitor report fails with:

  • Encountered "as row_number" — from get_models_latest_invocation macro
  • Encountered ", snapshots" — from CTE names in alert population macros

Review & Testing Checklist for Human

  • Verify ROW_NUMBER and SNAPSHOTS are listed on Dremio reserved keywords docs
  • Confirm no existing Dremio tests break with these additions (the macro only adds quoting for Dremio, no-op for other adapters)

Notes

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Enhanced reserved keyword recognition by adding "row_number" and "snapshots" to the list of recognized reserved keywords, ensuring these terms are properly handled during database operations and query execution.

These keywords are reserved in Dremio's Calcite SQL parser and need
to be quoted when used as column aliases or identifiers.

Co-Authored-By: Itamar Hartstein <haritamar@gmail.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

👋 @devin-ai-integration[bot]
Thank you for raising your pull request.
Please make sure to add tests and document all user-facing changes.
You can do this by editing the docs files in the elementary repository.

@coderabbitai
Copy link

coderabbitai bot commented Mar 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 9e7ed76 and 980c1bd.

📒 Files selected for processing (1)
  • macros/utils/sql_utils/escape_reserved_keywords.sql

📝 Walkthrough

Walkthrough

A Dremio-specific SQL macro's reserved keywords list has been expanded to include two additional keywords: "row_number" and "snapshots". The macro's core functionality of trimming and lowercasing input before comparison remains unchanged.

Changes

Cohort / File(s) Summary
Reserved Keywords List Expansion
macros/utils/sql_utils/escape_reserved_keywords.sql
Added "row_number" and "snapshots" to the reserved keywords set in the Dremio-specific macro to prevent these terms from being used unquoted in SQL operations.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 Two keywords hop into the reserve,
Row numbers and snapshots we'll preserve,
Dremio's list grows ever wise,
With careful syntax, no surprise! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: adding row_number and snapshots to Dremio reserved keywords.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch devin/1772501597-add-dremio-reserved-keywords

Comment @coderabbitai help to get the list of available commands and usage tips.

@haritamar haritamar merged commit b1c7a94 into master Mar 3, 2026
22 of 25 checks passed
@haritamar haritamar deleted the devin/1772501597-add-dremio-reserved-keywords branch March 3, 2026 01:36
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