Skip to content

Commit 8b24d79

Browse files
authored
fix FindWrapStats for wide lambda (#10662) (#10673)
1 parent 78b248c commit 8b24d79

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

ydb/core/kqp/opt/kqp_query_plan.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -826,15 +826,17 @@ class TxPlanSerializer {
826826
}
827827
}
828828
for (const auto& child : node->Children()) {
829-
std::shared_ptr<TOptimizerStatistics> result;
830829
if (child->IsLambda()) {
831-
auto lambda = TExprBase(child).Cast<TCoLambda>();
832-
result = FindWrapStats(lambda.Body().Ptr(), dataSourceNode);
830+
// support wide lambda as well
831+
for (size_t bodyIndex = 1; bodyIndex < child->ChildrenSize(); ++bodyIndex) {
832+
if (auto result = FindWrapStats(child->ChildPtr(bodyIndex), dataSourceNode)) {
833+
return result;
834+
}
835+
}
833836
} else {
834-
result = FindWrapStats(child, dataSourceNode);
835-
}
836-
if (result) {
837-
return result;
837+
if (auto result = FindWrapStats(child, dataSourceNode)) {
838+
return result;
839+
}
838840
}
839841
}
840842
return nullptr;

0 commit comments

Comments
 (0)