summaryrefslogtreecommitdiffstats
path: root/yql/essentials/sql/v1/complete/sql_complete.cpp
diff options
context:
space:
mode:
authorvityaman <[email protected]>2025-04-09 17:57:35 +0300
committerrobot-piglet <[email protected]>2025-04-09 18:12:05 +0300
commit394fee4aa8d48e58cf82c72bcb9dda0a5dd50190 (patch)
tree48fee02cc78dd77aaf1e5e96f2c1a70bd41dfb5d /yql/essentials/sql/v1/complete/sql_complete.cpp
parent0fd1b879589ea8263582a184ccbeac61fd38b596 (diff)
YQL-19747 Complete select and insert hints
- Related to https://github.com/ydb-platform/ydb/issues/9056 - Related to https://github.com/vityaman/ydb/issues/19 --- Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/1189 commit_hash:7f1cb1dcf0617aa2c94c3f2188fc9bd481380252
Diffstat (limited to 'yql/essentials/sql/v1/complete/sql_complete.cpp')
-rw-r--r--yql/essentials/sql/v1/complete/sql_complete.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/yql/essentials/sql/v1/complete/sql_complete.cpp b/yql/essentials/sql/v1/complete/sql_complete.cpp
index 85fcf87afd1..c3581bfc9ea 100644
--- a/yql/essentials/sql/v1/complete/sql_complete.cpp
+++ b/yql/essentials/sql/v1/complete/sql_complete.cpp
@@ -101,6 +101,12 @@ namespace NSQLComplete {
request.Constraints.Function = std::move(constraints);
}
+ if (context.Hint) {
+ THintName::TConstraints constraints;
+ constraints.Statement = context.Hint->StatementKind;
+ request.Constraints.Hint = std::move(constraints);
+ }
+
if (request.IsEmpty()) {
return;
}
@@ -125,6 +131,9 @@ namespace NSQLComplete {
name.Indentifier += "(";
return {ECandidateKind::FunctionName, std::move(name.Indentifier)};
}
+ if constexpr (std::is_base_of_v<THintName, T>) {
+ return {ECandidateKind::HintName, std::move(name.Indentifier)};
+ }
}, std::move(name)));
}
}
@@ -182,6 +191,9 @@ void Out<NSQLComplete::ECandidateKind>(IOutputStream& out, NSQLComplete::ECandid
case NSQLComplete::ECandidateKind::FunctionName:
out << "FunctionName";
break;
+ case NSQLComplete::ECandidateKind::HintName:
+ out << "HintName";
+ break;
}
}