orderKeyReferenceNames = new String[windowSpec.getSortSpecs().length]; for (int i = 0; i < windowSpec.getSortSpecs().length; i++) { key = windowSpec.getSortSpecs()[i].getKey(); visit(ctx, stack, key); String referenceName = ctx.block.namedExprsMgr.addExpr(key); if (OpType.isAggregationFunction(key.getType())) { ctx.aggExprs.add(new NamedExpr(key, referenceName)); windowSpec.getSortSpecs()[i].setKey(new ColumnReferenceExpr(referenceName));
orderKeyReferenceNames = new String[windowSpec.getSortSpecs().length]; for (int i = 0; i < windowSpec.getSortSpecs().length; i++) { key = windowSpec.getSortSpecs()[i].getKey(); visit(ctx, stack, key); String referenceName = ctx.block.namedExprsMgr.addExpr(key); if (OpType.isAggregationFunction(key.getType())) { ctx.aggExprs.add(new NamedExpr(key, referenceName)); windowSpec.getSortSpecs()[i].setKey(new ColumnReferenceExpr(referenceName));
sortKeys = new EvalNode[windowSpec.getSortSpecs().length]; for (int i = 0; i < windowSpec.getSortSpecs().length; i++) { key = windowSpec.getSortSpecs()[i].getKey(); sortKeys[i] = visit(ctx, stack, key);
WindowSpec spec = rawWindowSpecs.get(winSpecIdx); if (spec.hasOrderBy()) { Sort.SortSpec [] sortSpecs = spec.getSortSpecs(); int sortNum = sortSpecs.length; String [] sortKeyRefNames = windowSpecReferenceses[winSpecIdx].getOrderKeys();
WindowSpec spec = rawWindowSpecs.get(winSpecIdx); if (spec.hasOrderBy()) { Sort.SortSpec [] sortSpecs = spec.getSortSpecs(); int sortNum = sortSpecs.length; String [] sortKeyRefNames = windowSpecReferenceses[winSpecIdx].getOrderKeys();
sortKeys = new EvalNode[windowSpec.getSortSpecs().length]; for (int i = 0; i < windowSpec.getSortSpecs().length; i++) { key = windowSpec.getSortSpecs()[i].getKey(); sortKeys[i] = visit(ctx, stack, key);
@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; }