use of org.apache.asterix.lang.common.clause.LimitClause in project asterixdb by apache.
the class DeepCopyVisitor method visit.
@Override
public SelectExpression visit(SelectExpression selectExpression, Void arg) throws CompilationException {
List<LetClause> lets = new ArrayList<>();
SelectSetOperation select;
OrderbyClause orderby = null;
LimitClause limit = null;
// visit let list
if (selectExpression.hasLetClauses()) {
for (LetClause letClause : selectExpression.getLetList()) {
lets.add((LetClause) letClause.accept(this, arg));
}
}
// visit the main select.
select = (SelectSetOperation) selectExpression.getSelectSetOperation().accept(this, arg);
// visit order by
if (selectExpression.hasOrderby()) {
List<Expression> orderExprs = new ArrayList<>();
for (Expression orderExpr : selectExpression.getOrderbyClause().getOrderbyList()) {
orderExprs.add((Expression) orderExpr.accept(this, arg));
}
orderby = new OrderbyClause(orderExprs, selectExpression.getOrderbyClause().getModifierList());
}
// visit limit
if (selectExpression.hasLimit()) {
limit = (LimitClause) selectExpression.getLimitClause().accept(this, arg);
}
return new SelectExpression(lets, select, orderby, limit, selectExpression.isSubquery());
}
Aggregations