diff options
author | vityaman <[email protected]> | 2025-06-02 13:23:33 +0300 |
---|---|---|
committer | robot-piglet <[email protected]> | 2025-06-02 13:49:48 +0300 |
commit | f8dd75681a31f8b883f1c69db243a1ded8bb8d94 (patch) | |
tree | 4175cf2925fdc77e7f45bb9f84b65cc06a1a6829 /yql/essentials/sql/v1/complete/syntax/parser_call_stack.cpp | |
parent | 70ff3797ac5c7fd31a1f092b4074dee5668fa0b1 (diff) |
YQL-19747: Complete named expressions
- Introduced scoped name collection at global analysis
- Added `BingingsNameService` constructed after global analysis and united with the base service.
- Added dollar detection at local analysis.
After this point design should be reexamined and module should be refactored.
---
- Related to `YQL-19747`
- Related to https://github.com/ydb-platform/ydb/issues/9056
- Related to https://github.com/vityaman/ydb/issues/57
---
Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/1304
commit_hash:a7bf41703f0ee846e359407b53a5d62fc05928ea
Diffstat (limited to 'yql/essentials/sql/v1/complete/syntax/parser_call_stack.cpp')
-rw-r--r-- | yql/essentials/sql/v1/complete/syntax/parser_call_stack.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/yql/essentials/sql/v1/complete/syntax/parser_call_stack.cpp b/yql/essentials/sql/v1/complete/syntax/parser_call_stack.cpp index 03e07181a0d..efde1ea16b6 100644 --- a/yql/essentials/sql/v1/complete/syntax/parser_call_stack.cpp +++ b/yql/essentials/sql/v1/complete/syntax/parser_call_stack.cpp @@ -73,7 +73,11 @@ namespace NSQLComplete { RULE(Named_expr_list), RULE(Named_expr), RULE(Expr)}, stack) && - EndsWith({RULE(Atom_expr), RULE(An_id_or_type)}, stack)); + (EndsWith({RULE(Atom_expr), + RULE(An_id_or_type)}, stack) || + EndsWith({RULE(Atom_expr), + RULE(Bind_parameter), + RULE(An_id_or_type)}, stack))); } bool IsLikelyFunctionStack(const TParserCallStack& stack) { @@ -81,6 +85,10 @@ namespace NSQLComplete { EndsWith({RULE(Unary_casual_subexpr), RULE(Atom_expr), RULE(An_id_or_type)}, stack) || + EndsWith({RULE(Unary_casual_subexpr), + RULE(Atom_expr), + RULE(Bind_parameter), + RULE(An_id_or_type)}, stack) || EndsWith({RULE(Atom_expr), RULE(Id_or_type)}, stack); } @@ -109,6 +117,10 @@ namespace NSQLComplete { return Contains({RULE(Cluster_expr)}, stack); } + bool IsLikelyBindingStack(const TParserCallStack& stack) { + return EndsWith({RULE(Bind_parameter), RULE(An_id_or_type)}, stack); + } + TMaybe<EStatementKind> StatementKindOf(const TParserCallStack& stack) { for (TRuleId rule : std::ranges::views::reverse(stack)) { if (rule == RULE(Process_core) || rule == RULE(Reduce_core) || rule == RULE(Select_core)) { |