@Override public RESULT visitGroupBy(CONTEXT ctx, Stack<Expr> stack, Aggregation expr) throws TajoException { stack.push(expr); for (org.apache.tajo.algebra.Aggregation.GroupElement groupElement : expr.getGroupSet()) { for (Expr groupingSet : groupElement.getGroupingSets()) { visit(ctx, stack, groupingSet); } } RESULT result = visit(ctx, stack, expr.getChild()); stack.pop(); return result; }
@Override public RESULT visitGroupBy(CONTEXT ctx, Stack<Expr> stack, Aggregation expr) throws TajoException { stack.push(expr); for (org.apache.tajo.algebra.Aggregation.GroupElement groupElement : expr.getGroupSet()) { for (Expr groupingSet : groupElement.getGroupingSets()) { visit(ctx, stack, groupingSet); } } RESULT result = visit(ctx, stack, expr.getChild()); stack.pop(); return result; }
int groupingKeyNum = aggregation.getGroupSet()[0].getGroupingSets().length; ExprNormalizedResult [] normalizedResults = new ExprNormalizedResult[groupingKeyNum]; for (int i = 0; i < groupingKeyNum; i++) { Expr groupingKey = aggregation.getGroupSet()[0].getGroupingSets()[i]; normalizedResults[i] = normalizer.normalize(context, groupingKey);
int groupingKeyNum = aggregation.getGroupSet()[0].getGroupingSets().length; ExprNormalizedResult [] normalizedResults = new ExprNormalizedResult[groupingKeyNum]; for (int i = 0; i < groupingKeyNum; i++) { Expr groupingKey = aggregation.getGroupSet()[0].getGroupingSets()[i]; normalizedResults[i] = normalizer.normalize(context, groupingKey);
@Override public Expr visitGroupBy(Context context, Stack<Expr> stack, Aggregation expr) throws TajoException { super.visitGroupBy(context, stack, expr); // Enforcer only ordinary grouping set. for (Aggregation.GroupElement groupingElement : expr.getGroupSet()) { if (groupingElement.getType() != Aggregation.GroupType.OrdinaryGroup) { context.state.addVerification(ExceptionUtil.makeNotSupported(groupingElement.getType().name())); } } Projection projection = null; for (Expr parent : stack) { if (parent.getType() == OpType.Projection) { projection = (Projection) parent; break; } } if (projection == null) { throw new TajoInternalError("No Projection"); } return expr; }
@Override public Expr visitGroupBy(Context context, Stack<Expr> stack, Aggregation expr) throws TajoException { super.visitGroupBy(context, stack, expr); // Enforcer only ordinary grouping set. for (Aggregation.GroupElement groupingElement : expr.getGroupSet()) { if (groupingElement.getType() != Aggregation.GroupType.OrdinaryGroup) { context.state.addVerification(ExceptionUtil.makeNotSupported(groupingElement.getType().name())); } } Projection projection = null; for (Expr parent : stack) { if (parent.getType() == OpType.Projection) { projection = (Projection) parent; break; } } if (projection == null) { throw new TajoInternalError("No Projection"); } return expr; }