Skip to content

Commit

Permalink
Merge 117ee55 into 96d03d6
Browse files Browse the repository at this point in the history
  • Loading branch information
ssmike authored Oct 21, 2024
2 parents 96d03d6 + 117ee55 commit 6612596
Show file tree
Hide file tree
Showing 2 changed files with 13 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
11 changes: 11 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,17 @@ TExprBase DqPropagatePrecomuteTake(TExprBase node, TExprContext& ctx, IOptimizat
return node;
}

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

YQL_ENSURE(typeAnn);
typeAnn = GetSeqItemType(typeAnn);
if (typeAnn->GetKind() != ETypeAnnotationKind::List &&
typeAnn->GetKind() != ETypeAnnotationKind::Flow &&
typeAnn->GetKind() != ETypeAnnotationKind::Stream)
{
return node;
}

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

0 comments on commit 6612596

Please sign in to comment.