diff options
author | a-romanov <Anton.Romanov@ydb.tech> | 2023-10-16 11:21:24 +0300 |
---|---|---|
committer | a-romanov <Anton.Romanov@ydb.tech> | 2023-10-16 11:48:29 +0300 |
commit | 6e9f19f263172afcddaf7ee141c3dc5ad4d86ceb (patch) | |
tree | e99e554df808847281feca0c41a8ea3b702118bd | |
parent | 327d48079ec5b883bc34375f567f160adbbf07ed (diff) | |
download | ydb-6e9f19f263172afcddaf7ee141c3dc5ad4d86ceb.tar.gz |
YQL-15891 Swap Skip/Take with FromFlow/ForwardList.
-rw-r--r-- | ydb/library/yql/core/common_opt/yql_co_flow1.cpp | 10 |
1 files changed, 10 insertions, 0 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 fa3e81da7cb..f568b251ba4 100644 --- a/ydb/library/yql/core/common_opt/yql_co_flow1.cpp +++ b/ydb/library/yql/core/common_opt/yql_co_flow1.cpp @@ -1484,6 +1484,11 @@ void RegisterCoFlowCallables1(TCallableOptimizerMap& map) { return node; } + if (node->Head().IsCallable({"ForwardList", "FromFlow"})) { + YQL_CLOG(DEBUG, Core) << "Swap " << node->Content() << " with " << node->Head().Content(); + return ctx.SwapWithHead(*node); + } + if (TCoSkip::Match(&node->Head())) { YQL_CLOG(DEBUG, Core) << "Fuse " << node->Content() << " over " << node->Head().Content(); return FusePart<false>(*node, ctx); @@ -1509,6 +1514,11 @@ void RegisterCoFlowCallables1(TCallableOptimizerMap& map) { return node; } + if (node->Head().IsCallable({"ForwardList", "FromFlow"})) { + YQL_CLOG(DEBUG, Core) << "Swap " << node->Content() << " with " << node->Head().Content(); + return ctx.SwapWithHead(*node); + } + if (node->Head().IsCallable("Sort")) { YQL_CLOG(DEBUG, Core) << "Fuse " << node->Content() << " over " << node->Head().Content(); auto children = node->Head().ChildrenList(); |