diff options
author | aozeritsky <aozeritsky@yandex-team.ru> | 2022-02-12 10:42:59 +0300 |
---|---|---|
committer | aozeritsky <aozeritsky@yandex-team.ru> | 2022-02-12 10:42:59 +0300 |
commit | b56bbcc9f63bf31991a8aa118555ce0c12875a74 (patch) | |
tree | 974e2c4189be64ccc1da136be972b4145f197bac | |
parent | 0ee3731cb14b55158b428957f1c75544a0fb5b0f (diff) | |
download | ydb-b56bbcc9f63bf31991a8aa118555ce0c12875a74.tar.gz |
YQL-14354: EquiJoin
ref:71141e22080bd58b267621a873cdb1dab4a4ebe4
-rw-r--r-- | ydb/library/yql/providers/dq/opt/logical_optimize.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ydb/library/yql/providers/dq/opt/logical_optimize.cpp b/ydb/library/yql/providers/dq/opt/logical_optimize.cpp index 9e87f81e7c..012571a3f6 100644 --- a/ydb/library/yql/providers/dq/opt/logical_optimize.cpp +++ b/ydb/library/yql/providers/dq/opt/logical_optimize.cpp @@ -96,6 +96,7 @@ protected: TMaybeNode<TExprBase> RewriteEquiJoin(TExprBase node, TExprContext& ctx) { auto equiJoin = node.Cast<TCoEquiJoin>(); + bool hasDqConnections = false; for (size_t i = 0; i + 2 < equiJoin.ArgCount(); ++i) { auto list = equiJoin.Arg(i).Cast<TCoEquiJoinInput>().List(); if (auto maybeExtractMembers = list.Maybe<TCoExtractMembers>()) { @@ -104,11 +105,10 @@ protected: if (auto maybeFlatMap = list.Maybe<TCoFlatMapBase>()) { list = maybeFlatMap.Cast().Input(); } - if (!list.Maybe<TDqConnection>()) { - return node; - } + hasDqConnections |= !!list.Maybe<TDqConnection>(); } - return DqRewriteEquiJoin(node, ctx); + + return hasDqConnections ? DqRewriteEquiJoin(node, ctx) : node; } TMaybeNode<TExprBase> ExpandWindowFunctions(TExprBase node, TExprContext& ctx) { |