private static boolean isEmptyGrpAggr(RelNode gbNode) { // Verify if both groupset and aggrfunction are empty) Aggregate aggrnode = (Aggregate) gbNode; if (aggrnode.getGroupSet().isEmpty() && aggrnode.getAggCallList().isEmpty()) { return true; } return false; }
private static boolean isEmptyGrpAggr(RelNode gbNode) { // Verify if both groupset and aggrfunction are empty) Aggregate aggrnode = (Aggregate) gbNode; if (aggrnode.getGroupSet().isEmpty() && aggrnode.getAggCallList().isEmpty()) { return true; } return false; }
public void handle(Filter filter) { RelNode child = filter.getInput(); if (child instanceof Aggregate && !((Aggregate) child).getGroupSet().isEmpty()) { ASTConverter.this.having = filter; } else { ASTConverter.this.where = filter; } }
public void handle(Filter filter) { RelNode child = filter.getInput(); if (child instanceof Aggregate && !((Aggregate) child).getGroupSet().isEmpty()) { ASTConverter.this.having = filter; } else { ASTConverter.this.where = filter; } }
private static boolean validGBParent(RelNode gbNode, RelNode parent) { boolean validParent = true; // TOODO: Verify GB having is not a seperate filter (if so we shouldn't // introduce derived table) if (parent instanceof Join || parent instanceof SetOp || parent instanceof Aggregate || (parent instanceof Filter && ((Aggregate) gbNode).getGroupSet().isEmpty())) { validParent = false; } if (parent instanceof Project) { for (RexNode child : parent.getChildExps()) { if (child instanceof RexOver || child instanceof RexWinAggCall) { // Hive can't handle select rank() over(order by sum(c1)/sum(c2)) from t1 group by c3 // but can handle select rank() over (order by c4) from // (select sum(c1)/sum(c2) as c4 from t1 group by c3) t2; // so introduce a project on top of this gby. return false; } } } return validParent; }
private static boolean validGBParent(RelNode gbNode, RelNode parent) { boolean validParent = true; // TOODO: Verify GB having is not a seperate filter (if so we shouldn't // introduce derived table) if (parent instanceof Join || parent instanceof SetOp || parent instanceof Aggregate || (parent instanceof Filter && ((Aggregate) gbNode).getGroupSet().isEmpty())) { validParent = false; } if (parent instanceof Project) { for (RexNode child : parent.getChildExps()) { if (child instanceof RexOver || child instanceof RexWinAggCall) { // Hive can't handle select rank() over(order by sum(c1)/sum(c2)) from t1 group by c3 // but can handle select rank() over (order by c4) from // (select sum(c1)/sum(c2) as c4 from t1 group by c3) t2; // so introduce a project on top of this gby. return false; } } } return validParent; }
&& aggregate.getGroupSet().isEmpty()) { LOG.debug("Trigger countDistinct rewrite. numCountDistinct is " + numCountDistinct);
&& aggregate.getGroupSet().isEmpty()) { LOG.debug("Trigger countDistinct rewrite. numCountDistinct is " + numCountDistinct);
if (!aggregate.getGroupSet().isEmpty()) { return;
if(currentKey == null || currentKey.isEmpty()) { return originalGroupSet;
if (!aggregate.getGroupSet().isEmpty()) { return;
Set<RelDataTypeField> extraFields) { if ((aggregate.getIndicatorCount() > 0) || (aggregate.getGroupSet().isEmpty()) || fieldsUsed.contains(aggregate.getGroupSet())) { return aggregate;
if (!rCols.isEmpty() && groupKeys.contains(rCols)) { r = r.accept(new RexPermuteInputsShuttle(m, input)); aggPullUpPredicates.add(r);
if (!rCols.isEmpty() && groupKeys.contains(rCols)) { r = r.accept(new RexPermuteInputsShuttle(m, input)); aggPullUpPredicates.add(r);
public void onMatch(RelOptRuleCall call) { final Project topProject = call.rel(0); final Project bottomProject = call.rel(1); // If top project does not reference any column at the bottom project, // we can just remove botton project final ImmutableBitSet topRefs = RelOptUtil.InputFinder.bits(topProject.getChildExps(), null); if (topRefs.isEmpty()) { RelBuilder relBuilder = call.builder(); relBuilder.push(bottomProject.getInput()); relBuilder.project(topProject.getChildExps()); call.transformTo(relBuilder.build()); return; } super.onMatch(call); }
if ((!aggregate.getGroupSet().isEmpty()) || (aggregate.getAggCallList().size() != 1) || !(aggregate.getAggCallList().get(0).getAggregation()
if (!groupBy.getGroupSet().isEmpty()) { hiveAST.groupBy = b.node();
if (!groupBy.getGroupSet().isEmpty()) { hiveAST.groupBy = b.node();