Skip to content

Commit

Permalink
Tidy fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
EpsilonPrime committed Jan 30, 2024
1 parent 6758f3f commit af4fb1e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions src/substrait/textplan/parser/SubstraitPlanRelationVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ std::any SubstraitPlanRelationVisitor::visitRelationEmit(
ctx->getStart(), "Emits do not make sense for this kind of relation.");
return defaultResult();
}
typedef std::pair<int, int> intPair;
using intPair = std::pair<int, int>;
auto [stepsOut, fieldReference] = ANY_CAST(intPair, result);
if (stepsOut > 0) {
errorListener_->addError(
Expand Down Expand Up @@ -2123,12 +2123,13 @@ bool SubstraitPlanRelationVisitor::hasSubquery(
if (auto* funcUseCtx =
dynamic_cast<SubstraitPlanParser::ExpressionFunctionUseContext*>(
ctx)) {
for (auto* expr : funcUseCtx->expression()) {
if (hasSubquery(expr)) {
return true;
}
}
return false;
const auto& expressions = funcUseCtx->expression();
return any_of(
expressions.begin(),
expressions.end(),
[&](SubstraitPlanParser::ExpressionContext* expr) {
return hasSubquery(expr);
});
} else if (
auto* constantCtx =
dynamic_cast<SubstraitPlanParser::ExpressionConstantContext*>(ctx)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ std::any SubstraitPlanSubqueryRelationVisitor::visitRelationEmit(
ctx->getStart(), "Emits do not make sense for this kind of relation.");
return defaultResult();
}
typedef std::pair<int, int> intPair;
using intPair = std::pair<int, int>;
auto [stepsOut, fieldReference] = ANY_CAST(intPair, result);
if (stepsOut > 0) {
errorListener_->addError(
Expand Down

0 comments on commit af4fb1e

Please sign in to comment.