Repository navigation
Conversation
The ALIAS-to-expression substitution in `IndexDescription::getIndexFromAST` only rewrote the index KEY expression (`extractKeyExpressionList`), leaving index TYPE arguments untouched. A `text` index argument that references an ALIAS column -- e.g. `preprocessor = lower(combined)` where `combined ALIAS concat(title, ' ', body)` -- failed validation with "Missing columns: 'combined'", because at argument-validation time only the physical source columns exist. Apply the same alias substitution to the argument VALUES. Only the `text` index has expression-valued arguments (`preprocessor` / `postprocessor`) that may reference columns; every other index type takes positional literal arguments where an identifier is a value, not a column reference, so the substitution is scoped to `text`. To avoid clobbering a parameter NAME (a column aliased like `tokenizer` / `preprocessor`), only the value side (`children[1]`) of each `equals(key, value)` argument pair is visited, never the key. Ported from internal fix: https://git.woa.com/BigDataCore/Cooperative/TitanEngine/ClickHouse/-/merge_requests/60 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Contributor
Author
|
Closing as a duplicate — #103626 (by @ahmadov) already fixes this exact issue (#95944) with essentially the same approach (alias substitution scoped to the |
Member
Hi @YjyJeff, no worries! I'll prioritize that PR to merge it soon. |
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.
Closes: #95944
The ALIAS-to-expression substitution in
IndexDescription::getIndexFromASTonly rewrote the index KEY expression (extractKeyExpressionList), leaving index TYPE arguments untouched. Atextindex argument that references an ALIAS column — e.g.preprocessor = lower(combined)wherecombined ALIAS concat(title, ' ', body)— failed validation, because at argument-validation time only the physical source columns exist:This change applies the same alias substitution to the argument VALUES. Only the
textindex has expression-valued arguments (preprocessor/postprocessor) that may reference columns; every other index type takes positional literal arguments, where an identifier is a value rather than a column reference, so the substitution is scoped totext. To avoid clobbering a parameter NAME (a column aliased liketokenizer/preprocessor), only the value side (children[1]) of eachequals(key, value)argument pair is visited, never the key.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Allow
ALIAScolumns to be referenced intextindexpreprocessor/postprocessorarguments (e.g.preprocessor = lower(alias_col)), which previously failed validation with a "Missing columns" / "Preprocessor function must only reference column" error.Documentation entry for user-facing changes
🤖 Generated with Claude Code