-
Notifications
You must be signed in to change notification settings - Fork 735
[YQL-17453] Fix expanding DqReplicate with different input/output stream/flow types #818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -607,11 +607,29 @@ NNodes::TExprBase DqPeepholeRewriteReplicate(const NNodes::TExprBase& node, TExp | |
|
|
||
| TVector<TExprBase> branches; | ||
| branches.reserve(dqReplicate.Args().Count() - 1); | ||
| const auto inputKind = dqReplicate.Arg(0).Ref().GetTypeAnn()->GetKind(); | ||
| YQL_ENSURE(inputKind == ETypeAnnotationKind::Stream || inputKind == ETypeAnnotationKind::Flow); | ||
|
|
||
| auto inputIndex = NDq::BuildAtomList("0", dqReplicate.Pos(), ctx); | ||
| for (size_t i = 1; i < dqReplicate.Args().Count(); ++i) { | ||
| branches.emplace_back(inputIndex); | ||
| branches.emplace_back(ctx.DeepCopyLambda(dqReplicate.Args().Get(i).Ref())); | ||
| const auto lambdaOutputKind = dqReplicate.Arg(i).Ref().GetTypeAnn()->GetKind(); | ||
| YQL_ENSURE(lambdaOutputKind == ETypeAnnotationKind::Stream || lambdaOutputKind == ETypeAnnotationKind::Flow); | ||
| if (lambdaOutputKind != inputKind) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Как вообще могли получаться в DqReplicate лямбды с разными типами? Типизация DqReplicate не проверяет что ли это? Если нет, то нужно там править и править оптимизаторы, которые это порождают
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. не проверяет и не было очевидно что должна проверять |
||
| branches.emplace_back(ctx.Builder(dqReplicate.Arg(i).Pos()) | ||
| .Lambda() | ||
| .Param("arg") | ||
| .Callable(lambdaOutputKind == ETypeAnnotationKind::Stream ? "ToFlow" : "FromFlow") | ||
| .Apply(0, dqReplicate.Arg(i).Ptr()) | ||
| .With(0, "arg") | ||
| .Seal() | ||
| .Seal() | ||
| .Seal() | ||
| .Build() | ||
| ); | ||
| } else { | ||
| branches.emplace_back(ctx.DeepCopyLambda(dqReplicate.Arg(i).Ref())); | ||
| } | ||
| } | ||
|
|
||
| return Build<TCoSwitch>(ctx, dqReplicate.Pos()) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Разве может быть что-то другое по типизации?