Browse Source

Check NoYield flag in DQ optmizer

пример диагностики
Error: Cannot execute Apply over stream/flow inside DQ stage
PROCESS \$input
\^
commit_hash:5211a03edd7fd313d71dfbec23fd284617ca71c8
vvvv 2 months ago
parent
commit
2bb2097a0d
1 changed files with 9 additions and 0 deletions
  1. 9 0
      yql/essentials/core/yql_opt_utils.cpp

+ 9 - 0
yql/essentials/core/yql_opt_utils.cpp

@@ -1832,6 +1832,15 @@ TExprNode::TPtr FindNonYieldTransparentNodeImpl(const TExprNode::TPtr& root, con
                     }
                     return candidate;
                 }
+
+                auto callableType = candidate.Get()->Head().GetTypeAnn()->Cast<TCallableExprType>();
+                for (const auto& arg : callableType->GetArguments()) {
+                    if (arg.Type->GetKind() == ETypeAnnotationKind::Stream &&
+                        arg.Flags & NUdf::ICallablePayload::TArgumentFlags::NoYield) {
+                        return candidate;
+                    }
+                }
+
                 if (!udfSupportsYield) {
                     while (TCoApply::Match(candidate.Get())) {
                         candidate = candidate->HeadPtr();