diff options
author | a-romanov <a-romanov@yandex-team.ru> | 2022-04-19 17:15:10 +0300 |
---|---|---|
committer | a-romanov <a-romanov@yandex-team.ru> | 2022-04-19 17:15:10 +0300 |
commit | b967506a1256e0150f7f02dac7441da85d0be414 (patch) | |
tree | b9d2f9a521f3fefcf7d3e6dc772a51525fe64192 | |
parent | 45c297ca8e2a4cf1f2bcccf2be98c4036c8e6f6d (diff) | |
download | ydb-b967506a1256e0150f7f02dac7441da85d0be414.tar.gz |
YQL-14672 fix.
ref:d4cedf1a246190c0a89b3a6eed6ed0520dac7bcd
-rw-r--r-- | ydb/library/yql/core/common_opt/yql_co_flow1.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/ydb/library/yql/core/common_opt/yql_co_flow1.cpp b/ydb/library/yql/core/common_opt/yql_co_flow1.cpp index 975708d3763..99b5cbae475 100644 --- a/ydb/library/yql/core/common_opt/yql_co_flow1.cpp +++ b/ydb/library/yql/core/common_opt/yql_co_flow1.cpp @@ -166,7 +166,8 @@ TExprNode::TPtr FuseFlatmaps(TCoFlatMapBase outerMap, TExprContext& ctx, TTypeAn } if (innerBody.template Maybe<TCoOptionalIf>() || innerBody.template Maybe<TCoListIf>()) { - auto conditional = innerBody.template Cast<TCoConditionalValueBase>(); + const auto clonedInnerLambda = TCoLambda(ctx.DeepCopyLambda(innerMap.Lambda().Ref())); + const auto conditional = clonedInnerLambda.Body().template Cast<TCoConditionalValueBase>(); auto placeHolder = ctx.NewArgument(outerMap.Pos(), "placeholder"); auto outerLambda = outerMap.Lambda().Ptr(); @@ -222,7 +223,7 @@ TExprNode::TPtr FuseFlatmaps(TCoFlatMapBase outerMap, TExprContext& ctx, TTypeAn .template Body<TCoToFlow>() .template Input<TExprApplier>() .Apply(newBody) - .With(innerMap.Lambda().Args().Arg(0), "item") + .With(clonedInnerLambda.Args().Arg(0), "item") .With(TExprBase(placeHolder), "item") .Build() .Build() @@ -239,7 +240,7 @@ TExprNode::TPtr FuseFlatmaps(TCoFlatMapBase outerMap, TExprContext& ctx, TTypeAn .template Body<TCoToStream>() .template Input<TExprApplier>() .Apply(newBody) - .With(innerMap.Lambda().Args().Arg(0), "item") + .With(clonedInnerLambda.Args().Arg(0), "item") .With(TExprBase(placeHolder), "item") .Build() .FreeArgs() @@ -261,7 +262,7 @@ TExprNode::TPtr FuseFlatmaps(TCoFlatMapBase outerMap, TExprContext& ctx, TTypeAn .template Body<TCoToList>() .template Optional<TExprApplier>() .Apply(newBody) - .With(innerMap.Lambda().Args().Arg(0), "item") + .With(clonedInnerLambda.Args().Arg(0), "item") .With(TExprBase(placeHolder), "item") .Build() .Build() @@ -276,7 +277,7 @@ TExprNode::TPtr FuseFlatmaps(TCoFlatMapBase outerMap, TExprContext& ctx, TTypeAn .Args({"item"}) .template Body<TExprApplier>() .Apply(newBody) - .With(innerMap.Lambda().Args().Arg(0), "item") + .With(clonedInnerLambda.Args().Arg(0), "item") .With(TExprBase(placeHolder), "item") .Build() .Build() |