diff options
author | a-romanov <Anton.Romanov@ydb.tech> | 2023-06-26 13:11:49 +0300 |
---|---|---|
committer | a-romanov <Anton.Romanov@ydb.tech> | 2023-06-26 13:11:49 +0300 |
commit | 8bc751712e4349daeab76fa7739355261d7e759b (patch) | |
tree | 70263fbc10a53c599a74bcf76e3b1eba67e93af8 | |
parent | 0cdd7c9ab8aefcf43da14a2cfb1512267692e3c7 (diff) | |
download | ydb-8bc751712e4349daeab76fa7739355261d7e759b.tar.gz |
YQL-16126 Fix passtrought over ReplaceMember.
-rw-r--r-- | ydb/library/yql/core/yql_expr_constraint.cpp | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/ydb/library/yql/core/yql_expr_constraint.cpp b/ydb/library/yql/core/yql_expr_constraint.cpp index 56cb0634373..c4e0e538135 100644 --- a/ydb/library/yql/core/yql_expr_constraint.cpp +++ b/ydb/library/yql/core/yql_expr_constraint.cpp @@ -1576,21 +1576,8 @@ private: if (const auto structPassthrough = input->Head().GetConstraint<TPassthroughConstraintNode>(), fieldPasstrought = input->Tail().GetConstraint<TPassthroughConstraintNode>(); structPassthrough || fieldPasstrought) { - auto mapping = structPassthrough ? structPassthrough->GetColumnMapping() : TPassthroughConstraintNode::TMapType(); - if (const auto self = mapping.find(nullptr); mapping.cend() != self) - mapping.emplace(structPassthrough, std::move(mapping.extract(self).mapped())); - const TConstraintNode::TPathType key(1U, name); - for (auto p = mapping.begin(); mapping.end() != p;) { - if (auto it = p->second.lower_bound(key); p->second.cend() > it && it->first.front() == key.front()) { - do p->second.erase(it++); - while (p->second.end() > it && it->first.front() == key.front()); - if (p->second.empty()) { - mapping.erase(p++); - continue; - } - } - ++p; - } + const auto filtered = structPassthrough ? structPassthrough->FilterFields(ctx, [&name](const TConstraintNode::TPathType& path) { return !path.empty() && path.front() != name; }) : nullptr; + auto mapping = filtered ? filtered->GetColumnMapping() : TPassthroughConstraintNode::TMapType(); if (fieldPasstrought) { for (const auto& part : fieldPasstrought->GetColumnMapping()) { for (auto item : part.second) { |