diff options
author | vityaman <[email protected]> | 2025-06-11 14:10:16 +0300 |
---|---|---|
committer | robot-piglet <[email protected]> | 2025-06-11 14:25:30 +0300 |
commit | 64d942a7a113cfd57860923499139d09807bc610 (patch) | |
tree | 7c022060536c3fc361c8932be140610e32f67fd9 /yql/essentials/sql/v1/complete/sql_complete.cpp | |
parent | a4f376903fb769e2d40cc68cbb5ae8ce649b3a9c (diff) |
YQL-19747: Support table completion at CONCAT
---
- Related to `YQL-19747`
- Related to https://github.com/vityaman/ydb/issues/62
---
Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/1323
commit_hash:ebab6c3290ba984174c85bba35eeb066b53af5aa
Diffstat (limited to 'yql/essentials/sql/v1/complete/sql_complete.cpp')
-rw-r--r-- | yql/essentials/sql/v1/complete/sql_complete.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/yql/essentials/sql/v1/complete/sql_complete.cpp b/yql/essentials/sql/v1/complete/sql_complete.cpp index a7d8181862e..786155912c0 100644 --- a/yql/essentials/sql/v1/complete/sql_complete.cpp +++ b/yql/essentials/sql/v1/complete/sql_complete.cpp @@ -79,7 +79,7 @@ namespace NSQLComplete { TNameRequest NameRequestFrom( TCompletionInput input, - const TLocalSyntaxContext& context, + const TLocalSyntaxContext& context, // TODO(YQL-19747): rename to `local` const TGlobalContext& global) const { TNameRequest request = { .Prefix = TString(GetCompletedToken(input, context.EditRange).Content), @@ -134,6 +134,14 @@ namespace NSQLComplete { request.Constraints.Cluster = std::move(constraints); } + if (auto name = global.EnclosingFunction.Transform(NormalizeName); + name && name == "concat") { + auto& object = request.Constraints.Object; + object = object.Defined() ? object : TObjectNameConstraints(); + object->Kinds.emplace(EObjectKind::Folder); + object->Kinds.emplace(EObjectKind::Table); + } + return request; } @@ -196,14 +204,14 @@ namespace NSQLComplete { if constexpr (std::is_base_of_v<TFolderName, T>) { name.Indentifier.append('/'); - if (!context.Object->IsQuoted) { + if (!context.Object || !context.Object->IsQuoted) { name.Indentifier.prepend('`'); } return {ECandidateKind::FolderName, std::move(name.Indentifier)}; } if constexpr (std::is_base_of_v<TTableName, T>) { - if (!context.Object->IsQuoted) { + if (!context.Object || !context.Object->IsQuoted) { name.Indentifier.prepend('`'); } return {ECandidateKind::TableName, std::move(name.Indentifier)}; |