@Override public RESULT visitSort(CONTEXT ctx, Stack<Expr> stack, Sort expr) throws TajoException { stack.push(expr); for (Sort.SortSpec sortSpec : expr.getSortSpecs()) { visit(ctx, stack, sortSpec.getKey()); } RESULT result = visit(ctx, stack, expr.getChild()); return result; }
@Override public RESULT visitSort(CONTEXT ctx, Stack<Expr> stack, Sort expr) throws TajoException { stack.push(expr); for (Sort.SortSpec sortSpec : expr.getSortSpecs()) { visit(ctx, stack, sortSpec.getKey()); } RESULT result = visit(ctx, stack, expr.getChild()); return result; }
normalizedExprList[i] = normalizer.normalize(context, sortSpecs[i].getKey());
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);
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);
normalizedExprList[i] = normalizer.normalize(context, sortSpecs[i].getKey());
normalizedExprList[i] = normalizer.normalize(context, sortSpecs[i].getKey());
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);
int i = 0; for (SortSpec sortSpec : sortSpecs) { targets[i++] = new NamedExpr(sortSpec.getKey());
int i = 0; for (SortSpec sortSpec : sortSpecs) { targets.add(new NamedExpr(sortSpec.getKey()));
normalizedExprList[i] = normalizer.normalize(context, sortSpecs[i].getKey());
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);
@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; }
@Override public LogicalNode visitSort(ProcessorContext ctx, Stack<Expr> stack, Sort expr) throws TajoException { for (Sort.SortSpec sortSpec : expr.getSortSpecs()) { Set<ColumnReferenceExpr> columns = ExprFinder.finds(sortSpec.getKey(), OpType.Column); for (ColumnReferenceExpr col : columns) { if (!ctx.aliasSet.contains(col.getName())) { NameRefInSelectListNormalizer.normalize(ctx.planContext, col); TUtil.putToNestedList(ctx.projectColumns, col.getQualifier(), col); } } } super.visitSort(ctx, stack, expr); SortNode node = getNodeFromExpr(ctx.planContext.getPlan(), expr); LogicalNode child = getNonRelationListExpr(ctx.planContext.getPlan(), expr.getChild()); node.setInSchema(child.getOutSchema()); node.setOutSchema(node.getInSchema()); return node; }