Repository navigation
Conversation
|
I suppose we don't need to backport that since there are workarounds to avoid this bug. |
| { | ||
| result.arguments = index_type->arguments->clone(); | ||
|
|
||
| if (result.type == TEXT_INDEX_NAME) |
There was a problem hiding this comment.
Hmm, I don't really like that this is a text-index only path. Also, we are calling result.initExpressionInfo(...) above which runs very similar code. Maybe we can somehow unify?
|
Hi @ahmadov @rschu1ze — we hit this exact bug independently (a It looks like the only thing outstanding is @rschu1ze's design question from 2026-06-16 — whether the text-index-only substitution path can be unified with the alias substitution already done in Happy to help however is useful — reviewing, testing, or taking over the branch if @ahmadov is busy. Thanks for the work on this! |
| lower_tags Array(String) ALIAS arrayMap(x -> lower(x), tags), | ||
| INDEX idx(lower_tags) TYPE text( | ||
| tokenizer = array, | ||
| preprocessor = concat(lower_tags, '_suffix') |
There was a problem hiding this comment.
This case no longer exercises the lambda-shadowing path that ReplaceAliasByExpressionVisitor just added. preprocessor = concat(lower_tags, '_suffix') only proves plain alias expansion; if a table also has x String ALIAS 'shadow', removing the new private_aliases masking would still pass this test even though arrayMap(x -> lower(x), ...) would regress again.
Please add a focused case where the preprocessor itself contains a lambda whose parameter name collides with an ALIAS column, and assert that the DDL succeeds and the indexed tokens come from the lambda-local x.
|
|
||
| const auto * key = func->arguments->children[0]->as<ASTIdentifier>(); | ||
| if (key && key->name() == "preprocessor") | ||
| replaceAliasColumnsWithExpressions(func->arguments->children[1], columns); |
There was a problem hiding this comment.
Expanding the preprocessor AST in place here changes more than validation. For preprocessor = lower(name) on an ALIAS column, this rewrites the AST to lower(<alias expression>), so MergeTreeIndexTextPreprocessor::isLowerOrUpper never sets is_lower_or_upper anymore because it only recognizes lower / upper applied to an ASTIdentifier (src/Storages/MergeTree/MergeTreeIndexTextPreprocessor.cpp:154-159).
That, in turn, disables the text-index direct-read path for ILIKE in MergeTreeIndexConditionText, even though the equivalent physical-column definition still uses the optimization and the docs say ILIKE works with lower / upper preprocessors. Can we preserve the logical lower(name) form for this check, or relax isLowerOrUpper to accept an argument whose getColumnName() matches the indexed expression exactly?
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 42/42 (100.00%) · Uncovered code |
|
Superseded by #110014 |
Fixes #95944
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixes the referencing the
ALIAScolumns in the text indexpreprocessorexpression.