Escape aliases in metrics view search fallback query (value is reserved in Druid SQL) - #9891
Merged
Merged
Conversation
…rved in Druid SQL)
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Add a Druid-dialect regression assertion for fallback alias escaping.
Get a fresh assessment by requesting another Copilot review.
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 1
- Review effort level: Lite
pjain1
approved these changes
Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dimension_searchfeature flag) fails on Druid withIncorrect syntax near the keyword 'AS'. The SQL fallback forExecutor.Searchwraps each per-dimension query asSELECT '<dim>' AS dimension, "<dim>" AS value FROM (...), andVALUEis a reserved keyword in Druid's Calcite parser. The error columns reported in the thread (52 and 60) match the position ofAS valuefor theaccount_nameandline_item_alt_iddimensions exactly.AS "dimension"andAS "value". No change in behavior for DuckDB or ClickHouse, which do not reservevalue.executor_search_test.go, the first test covering the search fallback path (multiple dimensions, with and without a where clause and time range). Note it runs on DuckDB and so cannot reproduce the Druid keyword failure itself.Closes APP-935
Slack: https://rilldata.slack.com/archives/C02T907FEUB/p1789483677280479
Checklist: