diff options
author | a-romanov <Anton.Romanov@ydb.tech> | 2023-03-22 15:26:02 +0300 |
---|---|---|
committer | a-romanov <Anton.Romanov@ydb.tech> | 2023-03-22 15:26:02 +0300 |
commit | 2c05759d861c36a1e4fae2bc555b1d4cd6dcb139 (patch) | |
tree | 09ca2fcf1962dff67ae8983f98038354d031312f | |
parent | 7a9fc04ac03274fc8f3b4783ed6bd806c0436415 (diff) | |
download | ydb-2c05759d861c36a1e4fae2bc555b1d4cd6dcb139.tar.gz |
YQL-15785 Drop ForwardList only in case of single usage.
-rw-r--r-- | ydb/library/yql/core/common_opt/yql_co_flow1.cpp | 5 | ||||
-rw-r--r-- | ydb/library/yql/core/common_opt/yql_co_simple1.cpp | 2 |
2 files changed, 6 insertions, 1 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 00914926b1..ace50f61f9 100644 --- a/ydb/library/yql/core/common_opt/yql_co_flow1.cpp +++ b/ydb/library/yql/core/common_opt/yql_co_flow1.cpp @@ -1356,6 +1356,11 @@ TExprNode::TPtr OptimizeToFlow(const TExprNode::TPtr& node, TExprContext& ctx, T return node->Head().HeadPtr(); } + if (node->Head().IsCallable("ForwardList")) { + YQL_CLOG(DEBUG, Core) << "Drop " << node->Head().Content() << " under " << node->Content(); + return ctx.ChangeChild(*node, 0U, node->Head().HeadPtr()); + } + if (node->Head().IsCallable("Chopper")) { YQL_CLOG(DEBUG, Core) << "Swap " << node->Head().Content() << " with " << node->Content(); auto children = node->Head().ChildrenList(); 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 fc5e95e870..f71c96811a 100644 --- a/ydb/library/yql/core/common_opt/yql_co_simple1.cpp +++ b/ydb/library/yql/core/common_opt/yql_co_simple1.cpp @@ -2369,7 +2369,7 @@ TExprNode::TPtr OptimizeToFlow(const TExprNode::TPtr& node, TExprContext& ctx) { return ctx.NewCallable(node->Pos(), "EmptyIterator", {ExpandType(node->Pos(), *node->GetTypeAnn(), ctx)}); } - if (node->Head().IsCallable({"ForwardList", "LazyList", "ToStream"})) { + if (node->Head().IsCallable({"LazyList", "ToStream"})) { YQL_CLOG(DEBUG, Core) << "Drop " << node->Head().Content() << " under " << node->Content(); return ctx.ChangeChildren(*node, node->Head().ChildrenList()); } |