@Override public RESULT visitWindowFunction(CONTEXT ctx, Stack<Expr> stack, WindowFunctionExpr expr) throws TajoException { stack.push(expr); RESULT result = null; for (Expr param : expr.getParams()) { result = visit(ctx, stack, param); } WindowSpec windowSpec = expr.getWindowSpec(); if (windowSpec.hasPartitionBy()) { for (Expr partitionKey : windowSpec.getPartitionKeys()) { visit(ctx, stack, partitionKey); } } if (windowSpec.hasOrderBy()) { for (Sort.SortSpec sortKey : windowSpec.getSortSpecs()) { visit(ctx, stack, sortKey.getKey()); } } if (windowSpec.hasWindowFrame()) { if (windowSpec.getWindowFrame().getStartBound().hasNumber()) { visit(ctx, stack, windowSpec.getWindowFrame().getStartBound().getNumber()); } if (windowSpec.getWindowFrame().getEndBound().hasNumber()) { visit(ctx, stack, windowSpec.getWindowFrame().getEndBound().getNumber()); } } stack.pop(); return result; }
@Override public RESULT visitWindowFunction(CONTEXT ctx, Stack<Expr> stack, WindowFunctionExpr expr) throws TajoException { stack.push(expr); RESULT result = null; for (Expr param : expr.getParams()) { result = visit(ctx, stack, param); } WindowSpec windowSpec = expr.getWindowSpec(); if (windowSpec.hasPartitionBy()) { for (Expr partitionKey : windowSpec.getPartitionKeys()) { visit(ctx, stack, partitionKey); } } if (windowSpec.hasOrderBy()) { for (Sort.SortSpec sortKey : windowSpec.getSortSpecs()) { visit(ctx, stack, sortKey.getKey()); } } if (windowSpec.hasWindowFrame()) { if (windowSpec.getWindowFrame().getStartBound().hasNumber()) { visit(ctx, stack, windowSpec.getWindowFrame().getStartBound().getNumber()); } if (windowSpec.getWindowFrame().getEndBound().hasNumber()) { visit(ctx, stack, windowSpec.getWindowFrame().getEndBound().getNumber()); } } stack.pop(); return result; }