Skip to content

Commit

Permalink
[GLUTEN-7661][VL] Fix missing validation for native IfThen expr
Browse files Browse the repository at this point in the history
  • Loading branch information
wForget authored Oct 28, 2024
1 parent d8b0ee4 commit 190e9b4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,12 @@ bool SubstraitToVeloxPlanValidator::validateIfThen(
const ::substrait::Expression_IfThen& ifThen,
const RowTypePtr& inputType) {
for (const auto& subIfThen : ifThen.ifs()) {
return validateExpression(subIfThen.if_(), inputType) && validateExpression(subIfThen.then(), inputType);
if (!validateExpression(subIfThen.if_(), inputType) || !validateExpression(subIfThen.then(), inputType)) {
return false;
}
}
if (ifThen.has_else_() && !validateExpression(ifThen.else_(), inputType)) {
return false;
}
return true;
}
Expand Down

0 comments on commit 190e9b4

Please sign in to comment.