summaryrefslogtreecommitdiffstats
path: root/yql/essentials/sql/v1/query.cpp
diff options
context:
space:
mode:
authorAnton Romanov <[email protected]>2025-10-24 13:01:36 +0300
committerrobot-piglet <[email protected]>2025-10-24 13:43:13 +0300
commitcf1f9e1a05eadaceea111370a155174a96f97c3f (patch)
treebbc6761e85d48fd73bc11e7a62ba17efe7082479 /yql/essentials/sql/v1/query.cpp
parent92ce7a6fd59ba1c931d17bb1058940ca5fb4f088 (diff)
Initial support of CREATE TABLE
Type: feature Component: query-tracker --- Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/1457 Co-authored-by: aneporada <[email protected]> Co-authored-by: aneporada <[email protected]> Co-authored-by: aneporada <[email protected]> Co-authored-by: Tony-Romanov <[email protected]> commit_hash:e3ef0061d4a0469da3c5cda9ec32a1d0476e4bfe
Diffstat (limited to 'yql/essentials/sql/v1/query.cpp')
-rw-r--r--yql/essentials/sql/v1/query.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/yql/essentials/sql/v1/query.cpp b/yql/essentials/sql/v1/query.cpp
index 5b4a2c48799..7a3ceef7ebc 100644
--- a/yql/essentials/sql/v1/query.cpp
+++ b/yql/essentials/sql/v1/query.cpp
@@ -1268,19 +1268,24 @@ public:
opts = L(opts, Q(Y(Q("columnsDefaultValues"), Q(columnsDefaultValueSettings))));
}
- if (Table_.Service == RtmrProviderName) {
+ if (Table_.Service == YtProviderName || Table_.Service == RtmrProviderName) {
if (!Params_.PkColumns.empty() && !Params_.PartitionByColumns.empty()) {
ctx.Error() << "Only one of PRIMARY KEY or PARTITION BY constraints may be specified";
return false;
}
} else {
if (!Params_.OrderByColumns.empty()) {
- ctx.Error() << "ORDER BY is supported only for " << RtmrProviderName << " provider";
+ ctx.Error() << "ORDER BY is supported only for " << YtProviderName << " or " << RtmrProviderName << " provider.";
return false;
}
}
if (!Params_.PkColumns.empty()) {
+ if (Table_.Service == YtProviderName) {
+ ctx.Error() << "PRIMARY KEY is not supported by " << YtProviderName << " provider.";
+ return false;
+ }
+
auto primaryKey = Y();
for (auto& col : Params_.PkColumns) {
primaryKey = L(primaryKey, BuildQuotedAtom(col.Pos, col.Name));
@@ -1293,6 +1298,11 @@ public:
}
if (!Params_.PartitionByColumns.empty()) {
+ if (Table_.Service == YtProviderName) {
+ ctx.Error() << "PARTITION BY is not supported by " << YtProviderName << " provider.";
+ return false;
+ }
+
auto partitionBy = Y();
for (auto& col : Params_.PartitionByColumns) {
partitionBy = L(partitionBy, BuildQuotedAtom(col.Pos, col.Name));