aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authora-romanov <Anton.Romanov@ydb.tech>2023-04-10 11:18:52 +0300
committera-romanov <Anton.Romanov@ydb.tech>2023-04-10 11:18:52 +0300
commitc9e595c28aa6046c69f1b03c4b3583e3f0c642b2 (patch)
tree88fc11d4a43a309daf42dd6fb3a80a92ee273bf3
parent3e0fcfe80ecdcf2e1ea22a826cd9798d8a047942 (diff)
downloadydb-c9e595c28aa6046c69f1b03c4b3583e3f0c642b2.tar.gz
YQL-15435 Fix DictFromKeys constraints.
-rw-r--r--ydb/library/yql/core/yql_expr_constraint.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/ydb/library/yql/core/yql_expr_constraint.cpp b/ydb/library/yql/core/yql_expr_constraint.cpp
index 025b503c4f..2969939aef 100644
--- a/ydb/library/yql/core/yql_expr_constraint.cpp
+++ b/ydb/library/yql/core/yql_expr_constraint.cpp
@@ -1733,6 +1733,9 @@ private:
}
TStatus DictWrap(const TExprNode::TPtr& input, TExprNode::TPtr& output, TExprContext& ctx) const {
+ const std::vector<std::string_view> k(1U, ctx.GetIndexAsString(0U));
+ input->AddConstraint(ctx.MakeConstraint<TUniqueConstraintNode>(k));
+ input->AddConstraint(ctx.MakeConstraint<TDistinctConstraintNode>(k));
if (input->ChildrenSize() == 1) {
return FromEmpty(input, output, ctx);
}
@@ -1743,6 +1746,9 @@ private:
if (input->Child(1)->ChildrenSize() == 0) {
input->AddConstraint(ctx.MakeConstraint<TEmptyConstraintNode>());
}
+ const std::vector<std::string_view> k(1U, ctx.GetIndexAsString(0U));
+ input->AddConstraint(ctx.MakeConstraint<TUniqueConstraintNode>(k));
+ input->AddConstraint(ctx.MakeConstraint<TDistinctConstraintNode>(k));
return TStatus::Ok;
}