Skip to content

Commit

Permalink
Remove combineClause loop visit
Browse files Browse the repository at this point in the history
  • Loading branch information
zihaoAK47 committed Nov 10, 2023
1 parent 7574ca5 commit cfdee08
Showing 1 changed file with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -670,20 +670,17 @@ public ASTNode visitParenthesisSelectSubquery(final ParenthesisSelectSubqueryCon
}

private void setSelectCombineClause(final SelectCombineClauseContext ctx, final OracleSelectStatement result, final OracleSelectStatement left) {
for (int i = 0; i < ctx.selectSubquery().size(); i++) {
CombineType combineType;
if (null != ctx.UNION(i) && null != ctx.ALL(i)) {
combineType = CombineType.UNION_ALL;
} else if (null != ctx.UNION(i)) {
combineType = CombineType.UNION;
} else if (null != ctx.INTERSECT(i)) {
combineType = CombineType.INTERSECT;
} else {
combineType = CombineType.MINUS;
}
result.setCombine(new CombineSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), left,
combineType, (OracleSelectStatement) visit(ctx.selectSubquery(i))));
CombineType combineType;
if (null != ctx.UNION(0) && null != ctx.ALL(0)) {
combineType = CombineType.UNION_ALL;
} else if (null != ctx.UNION(0)) {
combineType = CombineType.UNION;
} else if (null != ctx.INTERSECT(0)) {
combineType = CombineType.INTERSECT;
} else {
combineType = CombineType.MINUS;
}
result.setCombine(new CombineSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), left, combineType, (OracleSelectStatement) visit(ctx.selectSubquery(0))));
}

@Override
Expand Down

0 comments on commit cfdee08

Please sign in to comment.