@Override public Void visit(OrderbyClause oc, Integer step) throws CompilationException { out.print(skip(step) + "order by "); printDelimitedObyExpressions(oc.getOrderbyList(), oc.getModifierList(), step); out.println(); return null; }
@Override public Void visit(OrderbyClause oc, Integer step) throws CompilationException { out.println(skip(step) + "Orderby"); List<OrderModifier> mlist = oc.getModifierList(); List<Expression> list = oc.getOrderbyList(); for (int i = 0; i < list.size(); i++) { list.get(i).accept(this, step + 1); out.println(skip(step + 1) + mlist.get(i).toString()); } out.println(); return null; }
@Override public OrderbyClause visit(OrderbyClause oc, Void arg) throws CompilationException { List<Expression> newOrderbyList = new ArrayList<>(); for (Expression orderExpr : oc.getOrderbyList()) { newOrderbyList.add((Expression) orderExpr.accept(this, arg)); } OrderbyClause copy = new OrderbyClause(newOrderbyList, new ArrayList<>(oc.getModifierList())); copy.setSourceLocation(oc.getSourceLocation()); return copy; }
@Override public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(OrderbyClause oc, VariableSubstitutionEnvironment env) throws CompilationException { List<Expression> exprList = VariableCloneAndSubstitutionUtil.visitAndCloneExprList(oc.getOrderbyList(), env, this); OrderbyClause oc2 = new OrderbyClause(exprList, new ArrayList<>(oc.getModifierList())); oc2.setNumFrames(oc.getNumFrames()); oc2.setNumTuples(oc.getNumTuples()); oc2.setRangeMap(oc.getRangeMap()); oc2.setSourceLocation(oc.getSourceLocation()); return new Pair<>(oc2, env); }
@Override public Pair<ILogicalOperator, LogicalVariable> visit(OrderbyClause oc, Mutable<ILogicalOperator> tupSource) throws CompilationException { SourceLocation sourceLoc = oc.getSourceLocation(); OrderOperator ord = new OrderOperator(); ord.setSourceLocation(sourceLoc); Iterator<OrderModifier> modifIter = oc.getModifierList().iterator(); Mutable<ILogicalOperator> topOp = tupSource; for (Expression e : oc.getOrderbyList()) { Pair<ILogicalExpression, Mutable<ILogicalOperator>> p = langExprToAlgExpression(e, topOp); OrderModifier m = modifIter.next(); OrderOperator.IOrder comp = translateOrderModifier(m); ord.getOrderExpressions().add(new Pair<>(comp, new MutableObject<>(p.first))); topOp = p.second; } ord.getInputs().add(topOp); if (oc.getNumTuples() > 0) { ord.getAnnotations().put(OperatorAnnotations.CARDINALITY, oc.getNumTuples()); } if (oc.getNumFrames() > 0) { ord.getAnnotations().put(OperatorAnnotations.MAX_NUMBER_FRAMES, oc.getNumFrames()); } if (oc.getRangeMap() != null) { Iterator<OrderModifier> orderModifIter = oc.getModifierList().iterator(); boolean ascending = orderModifIter.next() == OrderModifier.ASC; RangeMapBuilder.verifyRangeOrder(oc.getRangeMap(), ascending); ord.getAnnotations().put(OperatorAnnotations.USE_STATIC_RANGE, oc.getRangeMap()); } return new Pair<>(ord, null); }
orderByClause = OrderbyClause(); orderbyList = orderByClause.getOrderbyList(); orderbyModifierList = orderByClause.getModifierList(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IDENTIFIER: