Skip to content

Commit 32e8f89

Browse files
authored
Revert "Fix cross join with list iterator. (#4683)" (#7570)
1 parent 8f77485 commit 32e8f89

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

ydb/library/yql/core/common_opt/yql_co_simple1.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2074,12 +2074,6 @@ TExprNode::TPtr SimpleFlatMap(const TExprNode::TPtr& node, TExprContext& ctx, TO
20742074
}
20752075
}
20762076

2077-
if (lambdaBody.IsCallable("ForwardList")) {
2078-
const bool keepList = node->GetTypeAnn()->GetKind() == ETypeAnnotationKind::List && lambdaBody.Head().GetTypeAnn()->GetKind() == ETypeAnnotationKind::Flow;
2079-
YQL_CLOG(DEBUG, Core) << (keepList ? "Pull" : "Drop") << " out " << lambdaBody.Content() << " from " << node->Content() << " lambda root.";
2080-
return ctx.WrapByCallableIf(keepList, lambdaBody.Content(), ctx.ChangeChild(*node, 1U, ctx.DeepCopyLambda(node->Tail(), lambdaBody.HeadPtr())));
2081-
}
2082-
20832077
if (CanRewriteToEmptyContainer(*node)) {
20842078
const auto& inputToCheck = SkipCallables(node->Head(), SkippableCallables);
20852079
if (IsEmptyContainer(inputToCheck) || IsEmpty(inputToCheck, *optCtx.Types)) {

ydb/library/yql/core/peephole_opt/yql_opt_peephole_physical.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ TExprNode::TPtr ExpandEquiJoinImpl(const TExprNode& node, TExprContext& ctx) {
538538
const auto& renames = GetRenames(node, ctx);
539539
const auto& joinKind = node.Child(2)->Head().Content();
540540
if (joinKind == "Cross") {
541-
auto result = ctx.Builder(node.Pos())
541+
return ctx.Builder(node.Pos())
542542
.Callable("FlatMap")
543543
.Add(0, std::move(list1))
544544
.Lambda(1)
@@ -566,20 +566,6 @@ TExprNode::TPtr ExpandEquiJoinImpl(const TExprNode& node, TExprContext& ctx) {
566566
.Seal()
567567
.Seal()
568568
.Seal().Build();
569-
570-
if (const auto iterator = FindNode(result->Tail().Tail().HeadPtr(),
571-
[] (const TExprNode::TPtr& node) { return node->IsCallable("Iterator"); })) {
572-
auto children = iterator->ChildrenList();
573-
children.emplace_back(ctx.NewCallable(iterator->Pos(), "DependsOn", {result->Tail().Head().HeadPtr()}));
574-
result = ctx.ReplaceNode(std::move(result), *iterator, ctx.ChangeChildren(*iterator, std::move(children)));
575-
}
576-
577-
if (const auto forward = FindNode(result->Tail().Tail().HeadPtr(),
578-
[] (const TExprNode::TPtr& node) { return node->IsCallable("ForwardList"); })) {
579-
result = ctx.ReplaceNode(std::move(result), *forward, ctx.RenameNode(*forward, "Collect"));
580-
}
581-
582-
return result;
583569
}
584570

585571
const auto list1type = list1->GetTypeAnn()->Cast<TListExprType>()->GetItemType()->Cast<TStructExprType>();

0 commit comments

Comments
 (0)