summaryrefslogtreecommitdiffstats
path: root/yql/essentials/sql/v1/complete/analysis/global/parse_tree.cpp
diff options
context:
space:
mode:
authorvityaman <[email protected]>2025-06-02 13:23:33 +0300
committerrobot-piglet <[email protected]>2025-06-02 13:49:48 +0300
commitf8dd75681a31f8b883f1c69db243a1ded8bb8d94 (patch)
tree4175cf2925fdc77e7f45bb9f84b65cc06a1a6829 /yql/essentials/sql/v1/complete/analysis/global/parse_tree.cpp
parent70ff3797ac5c7fd31a1f092b4074dee5668fa0b1 (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/analysis/global/parse_tree.cpp')
-rw-r--r--yql/essentials/sql/v1/complete/analysis/global/parse_tree.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/yql/essentials/sql/v1/complete/analysis/global/parse_tree.cpp b/yql/essentials/sql/v1/complete/analysis/global/parse_tree.cpp
new file mode 100644
index 00000000000..2ed82752a01
--- /dev/null
+++ b/yql/essentials/sql/v1/complete/analysis/global/parse_tree.cpp
@@ -0,0 +1,20 @@
+#include "parse_tree.h"
+
+#include <util/system/yassert.h>
+#include <util/generic/maybe.h>
+
+namespace NSQLComplete {
+
+ TMaybe<std::string> GetId(SQLv1::Bind_parameterContext* ctx) {
+ if (auto* x = ctx->an_id_or_type()) {
+ return x->getText();
+ } else if (auto* x = ctx->TOKEN_TRUE()) {
+ return x->getText();
+ } else if (auto* x = ctx->TOKEN_FALSE()) {
+ return x->getText();
+ } else {
+ return Nothing();
+ }
+ }
+
+} // namespace NSQLComplete