Skip to content

Commit

Permalink
Merge a83c9d6 into 3fb6997
Browse files Browse the repository at this point in the history
  • Loading branch information
ssmike authored Oct 21, 2024
2 parents 3fb6997 + a83c9d6 commit d7a1927
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ydb/core/kqp/opt/physical/effects/kqp_opt_phy_returning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ TExprBase KqpRewriteReturningUpsert(TExprBase node, TExprContext& ctx, const TKq
return node;
}

if (!upsert.Input().Maybe<TDqPrecompute>() && !upsert.Input().Maybe<TDqPhyPrecompute>()) {
if (upsert.Input().Maybe<TDqPrecompute>() || upsert.Input().Maybe<TDqPhyPrecompute>()) {
return node;
}

Expand All @@ -226,7 +226,7 @@ TExprBase KqpRewriteReturningDelete(TExprBase node, TExprContext& ctx, const TKq
return node;
}

if (!del.Input().Maybe<TDqPrecompute>() && !del.Input().Maybe<TDqPhyPrecompute>()) {
if (del.Input().Maybe<TDqPrecompute>() || del.Input().Maybe<TDqPhyPrecompute>()) {
return node;
}

Expand Down
8 changes: 8 additions & 0 deletions ydb/library/yql/dq/opt/dq_opt_phy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2744,6 +2744,14 @@ TExprBase DqPropagatePrecomuteTake(TExprBase node, TExprContext& ctx, IOptimizat
return node;
}

auto* typeAnn = precompute.Connection().Raw()->GetTypeAnn();

YQL_ENSURE(typeAnn && typeAnn->GetKind() == ETypeAnnotationKind::List);
typeAnn = typeAnn->Cast<TListExprType>()->GetItemType();
if (typeAnn->GetKind() == ETypeAnnotationKind::Struct) {
return node;
}

auto takeLambda = Build<TCoLambda>(ctx, node.Pos())
.Args({"list_stream"})
.Body<TCoMap>()
Expand Down

0 comments on commit d7a1927

Please sign in to comment.