Skip to content

Commit

Permalink
feat: handle error from predicate skipping
Browse files Browse the repository at this point in the history
Signed-off-by: Andres Taylor <[email protected]>
  • Loading branch information
systay committed Oct 28, 2024
1 parent feaa6d5 commit 15d080a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions go/vt/vtgate/planbuilder/operators/SQL_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,14 +564,20 @@ func buildProjection(op *Projection, qb *queryBuilder) error {
}

func buildApplyJoin(op *ApplyJoin, qb *queryBuilder) error {
predicates := slice.Map(op.JoinPredicates, func(jc JoinColumn) sqlparser.Expr {
predicates, err := slice.MapWithError(op.JoinPredicates, func(jc JoinColumn) (sqlparser.Expr, error) {
// since we are adding these join predicates, we need to mark to broken up version (RHSExpr) of it as done
_ = qb.ctx.SkipJoinPredicates(jc.Original.Expr)
return jc.Original.Expr
err := qb.ctx.SkipJoinPredicates(jc.Original.Expr)
if err != nil {
return nil, err
}
return jc.Original.Expr, nil
})
if err != nil {
return err
}

pred := sqlparser.AndExpressions(predicates...)
err := buildQuery(op.LHS, qb)
err = buildQuery(op.LHS, qb)
if err != nil {
return err
}
Expand Down

0 comments on commit 15d080a

Please sign in to comment.