diff options
| author | vitya-smirnov <[email protected]> | 2025-10-07 09:34:39 +0300 |
|---|---|---|
| committer | vitya-smirnov <[email protected]> | 2025-10-07 09:52:14 +0300 |
| commit | babe7533f18c11be1f8a195ed2324d2d9a89436a (patch) | |
| tree | 45b7627141bf5a52b45a3d61fd1fbdd564bb8dd9 /yql/essentials/sql/v1/complete/core | |
| parent | 8fe7cfe254fde2772477a8933a163b5f303716b4 (diff) | |
YQL-20086 sql/v1
commit_hash:55bc611cdaa0d8a0fc3c4c7708ed9f17cc4976cf
Diffstat (limited to 'yql/essentials/sql/v1/complete/core')
| -rw-r--r-- | yql/essentials/sql/v1/complete/core/environment.h | 10 | ||||
| -rw-r--r-- | yql/essentials/sql/v1/complete/core/input.cpp | 24 | ||||
| -rw-r--r-- | yql/essentials/sql/v1/complete/core/input.h | 18 | ||||
| -rw-r--r-- | yql/essentials/sql/v1/complete/core/name.cpp | 26 | ||||
| -rw-r--r-- | yql/essentials/sql/v1/complete/core/name.h | 104 | ||||
| -rw-r--r-- | yql/essentials/sql/v1/complete/core/statement.h | 8 |
6 files changed, 95 insertions, 95 deletions
diff --git a/yql/essentials/sql/v1/complete/core/environment.h b/yql/essentials/sql/v1/complete/core/environment.h index 0f0299a9353..07a08a7d7ad 100644 --- a/yql/essentials/sql/v1/complete/core/environment.h +++ b/yql/essentials/sql/v1/complete/core/environment.h @@ -7,10 +7,10 @@ namespace NSQLComplete { - struct TEnvironment { - // Given `{ "$x": "{ "Data": "foo" }" }`, - // it will contain `{ "$x": "foo" }` - THashMap<TString, NYT::TNode> Parameters; - }; +struct TEnvironment { + // Given `{ "$x": "{ "Data": "foo" }" }`, + // it will contain `{ "$x": "foo" }` + THashMap<TString, NYT::TNode> Parameters; +}; } // namespace NSQLComplete diff --git a/yql/essentials/sql/v1/complete/core/input.cpp b/yql/essentials/sql/v1/complete/core/input.cpp index 8eca3a28ee8..0c0126c71ce 100644 --- a/yql/essentials/sql/v1/complete/core/input.cpp +++ b/yql/essentials/sql/v1/complete/core/input.cpp @@ -4,22 +4,22 @@ namespace NSQLComplete { - TCompletionInput SharpedInput(TString& text) { - constexpr char delim = '#'; +TCompletionInput SharpedInput(TString& text) { + constexpr char delim = '#'; - size_t pos = text.find_first_of(delim); - if (pos == TString::npos) { - return { - .Text = text, - }; - } - - Y_ENSURE(!TStringBuf(text).Tail(pos + 1).Contains(delim)); - text.erase(std::begin(text) + pos); + size_t pos = text.find_first_of(delim); + if (pos == TString::npos) { return { .Text = text, - .CursorPosition = pos, }; } + Y_ENSURE(!TStringBuf(text).Tail(pos + 1).Contains(delim)); + text.erase(std::begin(text) + pos); + return { + .Text = text, + .CursorPosition = pos, + }; +} + } // namespace NSQLComplete diff --git a/yql/essentials/sql/v1/complete/core/input.h b/yql/essentials/sql/v1/complete/core/input.h index 917ae5388c1..f64412181cb 100644 --- a/yql/essentials/sql/v1/complete/core/input.h +++ b/yql/essentials/sql/v1/complete/core/input.h @@ -4,16 +4,16 @@ namespace NSQLComplete { - struct TCompletionInput { - TStringBuf Text; - size_t CursorPosition = Text.length(); - }; +struct TCompletionInput { + TStringBuf Text; + size_t CursorPosition = Text.length(); +}; - struct TMaterializedInput { - TString Text; - size_t CursorPosition = Text.length(); - }; +struct TMaterializedInput { + TString Text; + size_t CursorPosition = Text.length(); +}; - TCompletionInput SharpedInput(TString& text Y_LIFETIME_BOUND); +TCompletionInput SharpedInput(TString& text Y_LIFETIME_BOUND); } // namespace NSQLComplete diff --git a/yql/essentials/sql/v1/complete/core/name.cpp b/yql/essentials/sql/v1/complete/core/name.cpp index 80a13ca773a..2caa488929d 100644 --- a/yql/essentials/sql/v1/complete/core/name.cpp +++ b/yql/essentials/sql/v1/complete/core/name.cpp @@ -7,22 +7,22 @@ namespace NSQLComplete { - bool operator<(const TTableId& lhs, const TTableId& rhs) { - return std::tie(lhs.Cluster, lhs.Path) < std::tie(rhs.Cluster, rhs.Path); - } +bool operator<(const TTableId& lhs, const TTableId& rhs) { + return std::tie(lhs.Cluster, lhs.Path) < std::tie(rhs.Cluster, rhs.Path); +} - TString LowerizeName(TStringBuf name) { - return ToLowerUTF8(name); - } +TString LowerizeName(TStringBuf name) { + return ToLowerUTF8(name); +} - TString NormalizeName(TStringBuf name) { - TString normalized(name); - TMaybe<NYql::TIssue> error = NYql::NormalizeName(NYql::TPosition(), normalized); - if (!error.Empty()) { - return LowerizeName(name); - } - return normalized; +TString NormalizeName(TStringBuf name) { + TString normalized(name); + TMaybe<NYql::TIssue> error = NYql::NormalizeName(NYql::TPosition(), normalized); + if (!error.Empty()) { + return LowerizeName(name); } + return normalized; +} } // namespace NSQLComplete diff --git a/yql/essentials/sql/v1/complete/core/name.h b/yql/essentials/sql/v1/complete/core/name.h index 367c532b3d0..80f0575dd29 100644 --- a/yql/essentials/sql/v1/complete/core/name.h +++ b/yql/essentials/sql/v1/complete/core/name.h @@ -5,58 +5,58 @@ namespace NSQLComplete { - enum class EObjectKind { - Folder, - Table, - Unknown, - }; - - enum class ENodeKind { - Any, - Table, - }; - - struct TTableId { - TString Cluster; - TString Path; - - friend bool operator<(const TTableId& lhs, const TTableId& rhs); - friend bool operator==(const TTableId& lhs, const TTableId& rhs) = default; - }; - - template <class T> - requires std::regular<T> && - requires(T x) { {x < x} -> std::convertible_to<bool>; } - struct TAliased: T { - TString Alias; - - TAliased(TString alias, T value) - : T(std::move(value)) - , Alias(std::move(alias)) - { - } - - TAliased(T value) - : T(std::move(value)) - { - } - - friend bool operator<(const TAliased& lhs, const TAliased& rhs) { - return std::tie(lhs.Alias, static_cast<const T&>(lhs)) < std::tie(rhs.Alias, static_cast<const T&>(rhs)); - } - - friend bool operator==(const TAliased& lhs, const TAliased& rhs) = default; - }; - - struct TColumnId { - TString TableAlias; - TString Name; - - friend bool operator<(const TColumnId& lhs, const TColumnId& rhs); - friend bool operator==(const TColumnId& lhs, const TColumnId& rhs) = default; - }; - - TString NormalizeName(TStringBuf name); +enum class EObjectKind { + Folder, + Table, + Unknown, +}; + +enum class ENodeKind { + Any, + Table, +}; + +struct TTableId { + TString Cluster; + TString Path; + + friend bool operator<(const TTableId& lhs, const TTableId& rhs); + friend bool operator==(const TTableId& lhs, const TTableId& rhs) = default; +}; + +template <class T> + requires std::regular<T> && + requires(T x) { {x < x} -> std::convertible_to<bool>; } +struct TAliased: T { + TString Alias; + + TAliased(TString alias, T value) + : T(std::move(value)) + , Alias(std::move(alias)) + { + } + + TAliased(T value) + : T(std::move(value)) + { + } + + friend bool operator<(const TAliased& lhs, const TAliased& rhs) { + return std::tie(lhs.Alias, static_cast<const T&>(lhs)) < std::tie(rhs.Alias, static_cast<const T&>(rhs)); + } + + friend bool operator==(const TAliased& lhs, const TAliased& rhs) = default; +}; + +struct TColumnId { + TString TableAlias; + TString Name; + + friend bool operator<(const TColumnId& lhs, const TColumnId& rhs); + friend bool operator==(const TColumnId& lhs, const TColumnId& rhs) = default; +}; + +TString NormalizeName(TStringBuf name); } // namespace NSQLComplete diff --git a/yql/essentials/sql/v1/complete/core/statement.h b/yql/essentials/sql/v1/complete/core/statement.h index d4c095a0e1f..eb0151084a3 100644 --- a/yql/essentials/sql/v1/complete/core/statement.h +++ b/yql/essentials/sql/v1/complete/core/statement.h @@ -2,9 +2,9 @@ namespace NSQLComplete { - enum class EStatementKind { - Select, - Insert, - }; +enum class EStatementKind { + Select, + Insert, +}; } // namespace NSQLComplete |
