diff options
author | Maxim Kovalev <maxkovalev@ydb.tech> | 2024-08-08 20:52:51 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-08 17:52:51 +0000 |
commit | 32e8f8919d42bfa612c64b04ff8f97ae6efa9e96 (patch) | |
tree | 843cf767c74be77ae7c8f81c07c20b6255a92b2c | |
parent | 8f7748574e0cfffe2d88a31577ce4ab61bc2b239 (diff) | |
download | ydb-32e8f8919d42bfa612c64b04ff8f97ae6efa9e96.tar.gz |
Revert "Fix cross join with list iterator. (#4683)" (#7570)
-rw-r--r-- | ydb/library/yql/core/common_opt/yql_co_simple1.cpp | 6 | ||||
-rw-r--r-- | ydb/library/yql/core/peephole_opt/yql_opt_peephole_physical.cpp | 16 |
2 files changed, 1 insertions, 21 deletions
diff --git a/ydb/library/yql/core/common_opt/yql_co_simple1.cpp b/ydb/library/yql/core/common_opt/yql_co_simple1.cpp index b9f6ac43ea..4b87f28594 100644 --- a/ydb/library/yql/core/common_opt/yql_co_simple1.cpp +++ b/ydb/library/yql/core/common_opt/yql_co_simple1.cpp @@ -2074,12 +2074,6 @@ TExprNode::TPtr SimpleFlatMap(const TExprNode::TPtr& node, TExprContext& ctx, TO } } - if (lambdaBody.IsCallable("ForwardList")) { - const bool keepList = node->GetTypeAnn()->GetKind() == ETypeAnnotationKind::List && lambdaBody.Head().GetTypeAnn()->GetKind() == ETypeAnnotationKind::Flow; - YQL_CLOG(DEBUG, Core) << (keepList ? "Pull" : "Drop") << " out " << lambdaBody.Content() << " from " << node->Content() << " lambda root."; - return ctx.WrapByCallableIf(keepList, lambdaBody.Content(), ctx.ChangeChild(*node, 1U, ctx.DeepCopyLambda(node->Tail(), lambdaBody.HeadPtr()))); - } - if (CanRewriteToEmptyContainer(*node)) { const auto& inputToCheck = SkipCallables(node->Head(), SkippableCallables); if (IsEmptyContainer(inputToCheck) || IsEmpty(inputToCheck, *optCtx.Types)) { diff --git a/ydb/library/yql/core/peephole_opt/yql_opt_peephole_physical.cpp b/ydb/library/yql/core/peephole_opt/yql_opt_peephole_physical.cpp index 611816bcee..b2ba6f7074 100644 --- a/ydb/library/yql/core/peephole_opt/yql_opt_peephole_physical.cpp +++ b/ydb/library/yql/core/peephole_opt/yql_opt_peephole_physical.cpp @@ -538,7 +538,7 @@ TExprNode::TPtr ExpandEquiJoinImpl(const TExprNode& node, TExprContext& ctx) { const auto& renames = GetRenames(node, ctx); const auto& joinKind = node.Child(2)->Head().Content(); if (joinKind == "Cross") { - auto result = ctx.Builder(node.Pos()) + return ctx.Builder(node.Pos()) .Callable("FlatMap") .Add(0, std::move(list1)) .Lambda(1) @@ -566,20 +566,6 @@ TExprNode::TPtr ExpandEquiJoinImpl(const TExprNode& node, TExprContext& ctx) { .Seal() .Seal() .Seal().Build(); - - if (const auto iterator = FindNode(result->Tail().Tail().HeadPtr(), - [] (const TExprNode::TPtr& node) { return node->IsCallable("Iterator"); })) { - auto children = iterator->ChildrenList(); - children.emplace_back(ctx.NewCallable(iterator->Pos(), "DependsOn", {result->Tail().Head().HeadPtr()})); - result = ctx.ReplaceNode(std::move(result), *iterator, ctx.ChangeChildren(*iterator, std::move(children))); - } - - if (const auto forward = FindNode(result->Tail().Tail().HeadPtr(), - [] (const TExprNode::TPtr& node) { return node->IsCallable("ForwardList"); })) { - result = ctx.ReplaceNode(std::move(result), *forward, ctx.RenameNode(*forward, "Collect")); - } - - return result; } const auto list1type = list1->GetTypeAnn()->Cast<TListExprType>()->GetItemType()->Cast<TStructExprType>(); |