Skip to content

Commit 4ef3616

Browse files
fix
1 parent 8f4d085 commit 4ef3616

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

velox/substrait/SubstraitToVeloxPlan.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,14 +1795,14 @@ core::TypedExprPtr SubstraitVeloxPlanConverter::connectWithAnd(
17951795
uint32_t idx = 1;
17961796
while (idx < ifThens.size()) {
17971797
ifThenFilter = connectWithAnd(
1798-
ifThenFilter,
1799-
exprConverter_->toVeloxExpr(ifThens[idx], inputType));
1798+
ifThenFilter, exprConverter_->toVeloxExpr(ifThens[idx], inputType));
18001799
idx += 1;
18011800
}
18021801
}
18031802

18041803
VELOX_CHECK(
1805-
scalarFilter != nullptr || orListFilter != nullptr || ifThenFilter != nullptr,
1804+
scalarFilter != nullptr || orListFilter != nullptr ||
1805+
ifThenFilter != nullptr,
18061806
"One filter should be valid.");
18071807
if (scalarFilter != nullptr && orListFilter != nullptr) {
18081808
auto filter = connectWithAnd(scalarFilter, orListFilter);
@@ -1815,11 +1815,12 @@ core::TypedExprPtr SubstraitVeloxPlanConverter::connectWithAnd(
18151815
return connectWithAnd(scalarFilter, ifThenFilter);
18161816
}
18171817
return scalarFilter;
1818-
} else {
1819-
// orListFilter != null
1818+
} else if (orListFilter != nullptr) {
18201819
if (ifThenFilter != nullptr) {
1821-
return connectWithAnd(ifThenFilter, ifThenFilter);
1820+
return connectWithAnd(orListFilter, ifThenFilter);
18221821
}
1822+
return orListFilter;
1823+
} else {
18231824
return ifThenFilter;
18241825
}
18251826
}

0 commit comments

Comments
 (0)