diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ExprNodeConverter.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ExprNodeConverter.java index 2d621e9..e840938 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ExprNodeConverter.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ExprNodeConverter.java @@ -59,13 +59,11 @@ import org.apache.hadoop.hive.ql.parse.PTFInvocationSpec.PartitionSpec; import org.apache.hadoop.hive.ql.parse.PTFInvocationSpec.PartitioningSpec; import org.apache.hadoop.hive.ql.parse.WindowingSpec.BoundarySpec; -import org.apache.hadoop.hive.ql.parse.WindowingSpec.CurrentRowSpec; import org.apache.hadoop.hive.ql.parse.WindowingSpec.Direction; -import org.apache.hadoop.hive.ql.parse.WindowingSpec.RangeBoundarySpec; -import org.apache.hadoop.hive.ql.parse.WindowingSpec.ValueBoundarySpec; import org.apache.hadoop.hive.ql.parse.WindowingSpec.WindowFrameSpec; import org.apache.hadoop.hive.ql.parse.WindowingSpec.WindowFunctionSpec; import org.apache.hadoop.hive.ql.parse.WindowingSpec.WindowSpec; +import org.apache.hadoop.hive.ql.parse.WindowingSpec.WindowType; import org.apache.hadoop.hive.ql.plan.ExprNodeColumnDesc; import org.apache.hadoop.hive.ql.plan.ExprNodeConstantDesc; import org.apache.hadoop.hive.ql.plan.ExprNodeDesc; @@ -426,38 +424,26 @@ private PartitioningSpec getPSpec(RexWindow window) { private WindowFrameSpec getWindowRange(RexWindow window) { // NOTE: in Hive AST Rows->Range(Physical) & Range -> Values (logical) - - WindowFrameSpec windowFrame = new WindowFrameSpec(); - BoundarySpec start = null; RexWindowBound ub = window.getUpperBound(); if (ub != null) { - start = getWindowBound(ub, window.isRows()); + start = getWindowBound(ub); } BoundarySpec end = null; RexWindowBound lb = window.getLowerBound(); if (lb != null) { - end = getWindowBound(lb, window.isRows()); + end = getWindowBound(lb); } - if (start != null || end != null) { - if (start != null) { - windowFrame.setStart(start); - } - if (end != null) { - windowFrame.setEnd(end); - } - } - - return windowFrame; + return new WindowFrameSpec(window.isRows() ? WindowType.ROWS : WindowType.RANGE, start, end); } - private BoundarySpec getWindowBound(RexWindowBound wb, boolean isRows) { + private BoundarySpec getWindowBound(RexWindowBound wb) { BoundarySpec boundarySpec; if (wb.isCurrentRow()) { - boundarySpec = new CurrentRowSpec(); + boundarySpec = new BoundarySpec(Direction.CURRENT); } else { final Direction direction; final int amt; @@ -471,11 +457,8 @@ private BoundarySpec getWindowBound(RexWindowBound wb, boolean isRows) { } else { amt = RexLiteral.intValue(wb.getOffset()); } - if (isRows) { - boundarySpec = new RangeBoundarySpec(direction, amt); - } else { - boundarySpec = new ValueBoundarySpec(direction, amt); - } + + boundarySpec = new BoundarySpec(direction, amt); } return boundarySpec; diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java index bf79e95..fdb468d 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java @@ -214,10 +214,10 @@ import org.apache.hadoop.hive.ql.parse.PTFInvocationSpec.PartitionSpec; import org.apache.hadoop.hive.ql.parse.QBExpr.Opcode; import org.apache.hadoop.hive.ql.parse.WindowingSpec.BoundarySpec; -import org.apache.hadoop.hive.ql.parse.WindowingSpec.RangeBoundarySpec; import org.apache.hadoop.hive.ql.parse.WindowingSpec.WindowExpressionSpec; import org.apache.hadoop.hive.ql.parse.WindowingSpec.WindowFunctionSpec; import org.apache.hadoop.hive.ql.parse.WindowingSpec.WindowSpec; +import org.apache.hadoop.hive.ql.parse.WindowingSpec.WindowType; import org.apache.hadoop.hive.ql.plan.ExprNodeColumnDesc; import org.apache.hadoop.hive.ql.plan.ExprNodeConstantDesc; import org.apache.hadoop.hive.ql.plan.ExprNodeDesc; @@ -3012,10 +3012,9 @@ private int getWindowSpecIndx(ASTNode wndAST) { WindowSpec wndSpec = ((WindowFunctionSpec) wExpSpec).getWindowSpec(); List partitionKeys = getPartitionKeys(wndSpec.getPartition(), converter, inputRR); List orderKeys = getOrderKeys(wndSpec.getOrder(), converter, inputRR); - RexWindowBound upperBound = getBound(wndSpec.getWindowFrame().start, converter); - RexWindowBound lowerBound = getBound(wndSpec.getWindowFrame().end, converter); - boolean isRows = ((wndSpec.getWindowFrame().start instanceof RangeBoundarySpec) || (wndSpec.getWindowFrame().end instanceof RangeBoundarySpec)) ? true - : false; + RexWindowBound upperBound = getBound(wndSpec.getWindowFrame().getStart(), converter); + RexWindowBound lowerBound = getBound(wndSpec.getWindowFrame().getEnd(), converter); + boolean isRows = wndSpec.getWindowFrame().getWindowType() == WindowType.ROWS; w = cluster.getRexBuilder().makeOver(calciteAggFnRetType, calciteAggFn, calciteAggFnArgs, partitionKeys, ImmutableList. copyOf(orderKeys), lowerBound, diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/PTFTranslator.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/PTFTranslator.java index 519f10d..ccfc4cd 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/parse/PTFTranslator.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/PTFTranslator.java @@ -50,19 +50,16 @@ import org.apache.hadoop.hive.ql.parse.PTFInvocationSpec.PartitionedTableFunctionSpec; import org.apache.hadoop.hive.ql.parse.PTFInvocationSpec.PartitioningSpec; import org.apache.hadoop.hive.ql.parse.WindowingSpec.BoundarySpec; -import org.apache.hadoop.hive.ql.parse.WindowingSpec.CurrentRowSpec; -import org.apache.hadoop.hive.ql.parse.WindowingSpec.RangeBoundarySpec; -import org.apache.hadoop.hive.ql.parse.WindowingSpec.ValueBoundarySpec; import org.apache.hadoop.hive.ql.parse.WindowingSpec.WindowExpressionSpec; import org.apache.hadoop.hive.ql.parse.WindowingSpec.WindowFrameSpec; import org.apache.hadoop.hive.ql.parse.WindowingSpec.WindowFunctionSpec; import org.apache.hadoop.hive.ql.parse.WindowingSpec.WindowSpec; +import org.apache.hadoop.hive.ql.parse.WindowingSpec.WindowType; import org.apache.hadoop.hive.ql.plan.ExprNodeDesc; import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc; import org.apache.hadoop.hive.ql.plan.PTFDesc; import org.apache.hadoop.hive.ql.plan.PTFDeserializer; import org.apache.hadoop.hive.ql.plan.ptf.BoundaryDef; -import org.apache.hadoop.hive.ql.plan.ptf.CurrentRowDef; import org.apache.hadoop.hive.ql.plan.ptf.OrderDef; import org.apache.hadoop.hive.ql.plan.ptf.OrderExpressionDef; import org.apache.hadoop.hive.ql.plan.ptf.PTFExpressionDef; @@ -70,9 +67,7 @@ import org.apache.hadoop.hive.ql.plan.ptf.PTFQueryInputDef; import org.apache.hadoop.hive.ql.plan.ptf.PartitionDef; import org.apache.hadoop.hive.ql.plan.ptf.PartitionedTableFunctionDef; -import org.apache.hadoop.hive.ql.plan.ptf.RangeBoundaryDef; import org.apache.hadoop.hive.ql.plan.ptf.ShapeDetails; -import org.apache.hadoop.hive.ql.plan.ptf.ValueBoundaryDef; import org.apache.hadoop.hive.ql.plan.ptf.WindowFrameDef; import org.apache.hadoop.hive.ql.plan.ptf.WindowFunctionDef; import org.apache.hadoop.hive.ql.plan.ptf.WindowTableFunctionDef; @@ -521,11 +516,12 @@ private WindowFrameDef translate(String wFnName, ShapeDetails inpShape, WindowSp * Since we componentize Windowing, no need to translate * the Partition & Order specs of individual WFns. */ - return translate(inpShape, spec.getWindowFrame()); + return translate(inpShape, spec.getWindowFrame(), spec.getOrder().getExpressions()); } private WindowFrameDef translate(ShapeDetails inpShape, - WindowFrameSpec spec) + WindowFrameSpec spec, + List orderExpressions) throws SemanticException { if (spec == null) { return null; @@ -539,38 +535,38 @@ private WindowFrameDef translate(ShapeDetails inpShape, "Window range invalid, start boundary is greater than end boundary: %s", spec)); } - return new WindowFrameDef(translate(inpShape, s), translate(inpShape, e)); + WindowFrameDef winFrame = new WindowFrameDef( + spec.getWindowType(), + new BoundaryDef(s.direction, s.getAmt()), + new BoundaryDef(e.direction, e.getAmt())); + if (winFrame.getWindowType() == WindowType.RANGE) { + winFrame.setOrderDef(buildOrderExpressions(inpShape, orderExpressions)); + } + return winFrame; } - private BoundaryDef translate(ShapeDetails inpShape, BoundarySpec bndSpec) + /** + * Collect order expressions for RANGE based windowing + * @throws SemanticException + */ + private OrderDef buildOrderExpressions(ShapeDetails inpShape, List orderExpressions) throws SemanticException { - if (bndSpec instanceof ValueBoundarySpec) { - ValueBoundarySpec vBndSpec = (ValueBoundarySpec) bndSpec; - ValueBoundaryDef vbDef = new ValueBoundaryDef(vBndSpec.getDirection(), vBndSpec.getAmt()); - for (OrderExpression oe : vBndSpec.getOrderExpressions()) { - PTFTranslator.validateNoLeadLagInValueBoundarySpec(oe.getExpression()); - PTFExpressionDef exprDef = null; - try { - exprDef = buildExpressionDef(inpShape, oe.getExpression()); - } catch (HiveException he) { - throw new SemanticException(he); - } - PTFTranslator.validateValueBoundaryExprType(exprDef.getOI()); - OrderExpressionDef orderExprDef = new OrderExpressionDef(exprDef); - orderExprDef.setOrder(oe.getOrder()); - orderExprDef.setNullOrder(oe.getNullOrder()); - vbDef.addOrderExpressionDef(orderExprDef); + OrderDef orderDef = new OrderDef(); + for (OrderExpression oe : orderExpressions) { + PTFTranslator.validateNoLeadLagInValueBoundarySpec(oe.getExpression()); + PTFExpressionDef exprDef = null; + try { + exprDef = buildExpressionDef(inpShape, oe.getExpression()); + } catch (HiveException he) { + throw new SemanticException(he); } - return vbDef; - } - else if (bndSpec instanceof RangeBoundarySpec) { - RangeBoundarySpec rBndSpec = (RangeBoundarySpec) bndSpec; - return new RangeBoundaryDef(rBndSpec.getDirection(), rBndSpec.getAmt()); - } else if (bndSpec instanceof CurrentRowSpec) { - CurrentRowDef cbDef = new CurrentRowDef(); - return cbDef; + PTFTranslator.validateValueBoundaryExprType(exprDef.getOI()); + OrderExpressionDef orderExprDef = new OrderExpressionDef(exprDef); + orderExprDef.setOrder(oe.getOrder()); + orderExprDef.setNullOrder(oe.getNullOrder()); + orderDef.addExpression(orderExprDef); } - throw new SemanticException("Unknown Boundary: " + bndSpec); + return orderDef; } static void setupWdwFnEvaluator(WindowFunctionDef def) throws HiveException { diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java index 71d34eb..30987e0 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java @@ -150,14 +150,12 @@ import org.apache.hadoop.hive.ql.parse.QBSubQuery.SubQueryType; import org.apache.hadoop.hive.ql.parse.SubQueryUtils.ISubQueryJoinInfo; import org.apache.hadoop.hive.ql.parse.WindowingSpec.BoundarySpec; -import org.apache.hadoop.hive.ql.parse.WindowingSpec.CurrentRowSpec; import org.apache.hadoop.hive.ql.parse.WindowingSpec.Direction; -import org.apache.hadoop.hive.ql.parse.WindowingSpec.RangeBoundarySpec; -import org.apache.hadoop.hive.ql.parse.WindowingSpec.ValueBoundarySpec; import org.apache.hadoop.hive.ql.parse.WindowingSpec.WindowExpressionSpec; import org.apache.hadoop.hive.ql.parse.WindowingSpec.WindowFrameSpec; import org.apache.hadoop.hive.ql.parse.WindowingSpec.WindowFunctionSpec; import org.apache.hadoop.hive.ql.parse.WindowingSpec.WindowSpec; +import org.apache.hadoop.hive.ql.parse.WindowingSpec.WindowType; import org.apache.hadoop.hive.ql.plan.AggregationDesc; import org.apache.hadoop.hive.ql.plan.AlterTableDesc; import org.apache.hadoop.hive.ql.plan.AlterTableDesc.AlterTableTypes; @@ -12760,13 +12758,12 @@ private WindowFrameSpec processWindowFrame(ASTNode node) throws SemanticExceptio if ( node.getChildCount() > 1 ) { end = processBoundary(type, (ASTNode) node.getChild(1)); } - - return new WindowFrameSpec(start, end); + // Note: TOK_WINDOWVALUES means RANGE type, TOK_WINDOWRANGE means ROWS type + return new WindowFrameSpec(type == HiveParser.TOK_WINDOWVALUES ? WindowType.RANGE : WindowType.ROWS, start, end); } private BoundarySpec processBoundary(int frameType, ASTNode node) throws SemanticException { - BoundarySpec bs = frameType == HiveParser.TOK_WINDOWRANGE ? - new RangeBoundarySpec() : new ValueBoundarySpec(); + BoundarySpec bs = new BoundarySpec(); int type = node.getType(); boolean hasAmt = true; @@ -12779,7 +12776,7 @@ private BoundarySpec processBoundary(int frameType, ASTNode node) throws Semant bs.setDirection(Direction.FOLLOWING); break; case HiveParser.KW_CURRENT: - bs = new CurrentRowSpec(); + bs.setDirection(Direction.CURRENT); hasAmt = false; break; } diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/WindowingSpec.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/WindowingSpec.java index ef5186a..a0cf10f 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/parse/WindowingSpec.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/WindowingSpec.java @@ -20,12 +20,9 @@ import java.util.ArrayList; import java.util.HashMap; -import java.util.List; - import org.antlr.runtime.CommonToken; import org.apache.hadoop.hive.ql.exec.FunctionRegistry; import org.apache.hadoop.hive.ql.exec.WindowFunctionInfo; -import org.apache.hadoop.hive.ql.parse.PTFInvocationSpec.OrderExpression; import org.apache.hadoop.hive.ql.parse.PTFInvocationSpec.OrderSpec; import org.apache.hadoop.hive.ql.parse.PTFInvocationSpec.PartitionExpression; import org.apache.hadoop.hive.ql.parse.PTFInvocationSpec.PartitionSpec; @@ -140,13 +137,13 @@ public void validateAndMakeEffective() throws SemanticException { // 3. For missing Wdw Frames or for Frames with only a Start Boundary, completely // specify them by the rules in {@link effectiveWindowFrame} - effectiveWindowFrame(wFn, wdwSpec); + effectiveWindowFrame(wFn); // 4. Validate the effective Window Frames with the rules in {@link validateWindowFrame} validateWindowFrame(wdwSpec); // 5. Add the Partition expressions as the Order if there is no Order and validate Order spec. - setAndValidateOrderSpec(wFn, wdwSpec); + setAndValidateOrderSpec(wFn); } } @@ -199,24 +196,22 @@ private void applyConstantPartition(WindowSpec wdwSpec) { } /* - * - A Window Frame that has only the /start/boundary, then it is interpreted as: - BETWEEN AND CURRENT ROW - * - A Window Specification with an Order Specification and no Window - * Frame is interpreted as: - ROW BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW + * - A Window Frame that has only the start boundary, then it is interpreted as: + * BETWEEN AND CURRENT ROW + * - A Window Specification with an Order Specification and no Window Frame is + * interpreted as: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW * - A Window Specification with no Order and no Window Frame is interpreted as: - ROW BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING + * ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING */ - private void effectiveWindowFrame(WindowFunctionSpec wFn, WindowSpec wdwSpec) + private void effectiveWindowFrame(WindowFunctionSpec wFn) throws SemanticException { - + WindowSpec wdwSpec = wFn.getWindowSpec(); WindowFunctionInfo wFnInfo = FunctionRegistry.getWindowFunctionInfo(wFn.getName()); boolean supportsWindowing = wFnInfo == null ? true : wFnInfo.isSupportsWindow(); WindowFrameSpec wFrame = wdwSpec.getWindowFrame(); OrderSpec orderSpec = wdwSpec.getOrder(); if ( wFrame == null ) { if (!supportsWindowing ) { - if ( wFn.getName().toLowerCase().equals(FunctionRegistry.LAST_VALUE_FUNC_NAME) && orderSpec != null ) { /* @@ -224,33 +219,37 @@ private void effectiveWindowFrame(WindowFunctionSpec wFn, WindowSpec wdwSpec) * last value among rows with the same Sort Key value. */ wFrame = new WindowFrameSpec( - new CurrentRowSpec(), - new RangeBoundarySpec(Direction.FOLLOWING, 0) + WindowType.ROWS, + new BoundarySpec(Direction.CURRENT), + new BoundarySpec(Direction.FOLLOWING, 0) + ); + } else { + wFrame = new WindowFrameSpec( + WindowType.ROWS, + new BoundarySpec(Direction.PRECEDING, BoundarySpec.UNBOUNDED_AMOUNT), + new BoundarySpec(Direction.FOLLOWING, BoundarySpec.UNBOUNDED_AMOUNT) ); } - else { + } else { + if ( orderSpec == null ) { wFrame = new WindowFrameSpec( - new RangeBoundarySpec(Direction.PRECEDING, BoundarySpec.UNBOUNDED_AMOUNT), - new RangeBoundarySpec(Direction.FOLLOWING, BoundarySpec.UNBOUNDED_AMOUNT) + WindowType.ROWS, + new BoundarySpec(Direction.PRECEDING, BoundarySpec.UNBOUNDED_AMOUNT), + new BoundarySpec(Direction.FOLLOWING, BoundarySpec.UNBOUNDED_AMOUNT) ); + } else { + wFrame = new WindowFrameSpec( + WindowType.RANGE, + new BoundarySpec(Direction.PRECEDING, BoundarySpec.UNBOUNDED_AMOUNT), + new BoundarySpec(Direction.CURRENT) + ); } } - else if ( orderSpec == null ) { - wFrame = new WindowFrameSpec( - new RangeBoundarySpec(Direction.PRECEDING, BoundarySpec.UNBOUNDED_AMOUNT), - new RangeBoundarySpec(Direction.FOLLOWING, BoundarySpec.UNBOUNDED_AMOUNT) - ); - } - else { - wFrame = new WindowFrameSpec( - new ValueBoundarySpec(Direction.PRECEDING, BoundarySpec.UNBOUNDED_AMOUNT), - new CurrentRowSpec() - ); - } + wdwSpec.setWindowFrame(wFrame); } else if ( wFrame.getEnd() == null ) { - wFrame.setEnd(new CurrentRowSpec()); + wFrame.setEnd(new BoundarySpec(Direction.CURRENT)); } } @@ -273,19 +272,19 @@ private void validateWindowFrame(WindowSpec wdwSpec) throws SemanticException { /** * Add default order spec if there is no order and validate order spec for valued based * windowing since only one sort key is allowed. - * @param wdwSpec + * @param wFn Window function spec * @throws SemanticException */ - private void setAndValidateOrderSpec(WindowFunctionSpec wFn, WindowSpec wdwSpec) throws SemanticException { + private void setAndValidateOrderSpec(WindowFunctionSpec wFn) throws SemanticException { + WindowSpec wdwSpec = wFn.getWindowSpec(); wdwSpec.ensureOrderSpec(wFn); - WindowFrameSpec wFrame = wdwSpec.getWindowFrame(); OrderSpec order = wdwSpec.getOrder(); BoundarySpec start = wFrame.getStart(); BoundarySpec end = wFrame.getEnd(); - if (start instanceof ValueBoundarySpec || end instanceof ValueBoundarySpec) { + if (wFrame.getWindowType() == WindowType.RANGE) { if (order == null || order.getExpressions().size() == 0) { throw new SemanticException("Range based Window Frame needs to specify ORDER BY clause"); } @@ -304,13 +303,6 @@ private void setAndValidateOrderSpec(WindowFunctionSpec wFn, WindowSpec wdwSpec) if ( order.getExpressions().size() != 1 && !multiOrderAllowed) { throw new SemanticException("Range value based Window Frame can have only 1 Sort Key"); } - - if (start instanceof ValueBoundarySpec) { - ((ValueBoundarySpec)start).setOrderExpressions(order.getExpressions()); - } - if (end instanceof ValueBoundarySpec) { - ((ValueBoundarySpec)end).setOrderExpressions(order.getExpressions()); - } } } @@ -518,22 +510,20 @@ public String toString() { */ public static class WindowFrameSpec { - BoundarySpec start; - BoundarySpec end; + private WindowType windowType; + private BoundarySpec start; + private BoundarySpec end; - public WindowFrameSpec() { - } - - public WindowFrameSpec(BoundarySpec start, BoundarySpec end) + public WindowFrameSpec(WindowType windowType, BoundarySpec start, BoundarySpec end) { - super(); + this.windowType = windowType; this.start = start; this.end = end; } - public WindowFrameSpec(BoundarySpec start) + public WindowFrameSpec(WindowType windowType, BoundarySpec start) { - this(start, null); + this(windowType, start, null); } public BoundarySpec getStart() @@ -556,10 +546,15 @@ public void setEnd(BoundarySpec end) this.end = end; } + public WindowType getWindowType() { + return this.windowType; + } + @Override public String toString() { - return String.format("window(start=%s, end=%s)", start, end); + return String.format("window(type=%s, start=%s, end=%s)", + this.windowType, start, end); } } @@ -571,6 +566,13 @@ public String toString() FOLLOWING }; + // The types for ROWS BETWEEN or RANGE BETWEEN windowing spec + public static enum WindowType + { + ROWS, + RANGE + }; + /* * A Boundary specifies how many rows back/forward a WindowFrame extends from the * current row. A Boundary is specified as: @@ -580,152 +582,41 @@ public String toString() * - Value Boundary :: which is specified as the amount the value of an Expression must decrease/increase */ - public abstract static class BoundarySpec implements Comparable + public static class BoundarySpec implements Comparable { public static int UNBOUNDED_AMOUNT = Integer.MAX_VALUE; - public abstract Direction getDirection(); - public abstract void setDirection(Direction dir); - public abstract void setAmt(int amt); - public abstract int getAmt(); - } - - public static class RangeBoundarySpec extends BoundarySpec - { - Direction direction; int amt; - public RangeBoundarySpec() { - } - - public RangeBoundarySpec(Direction direction, int amt) - { - super(); - this.direction = direction; - this.amt = amt; - } - - @Override - public Direction getDirection() - { - return direction; - } - - @Override - public void setDirection(Direction direction) - { - this.direction = direction; - } - - @Override - public int getAmt() - { - return amt; - } - - @Override - public void setAmt(int amt) - { - this.amt = amt; - } - - @Override - public String toString() - { - return String.format("range(%s %s)", (amt == UNBOUNDED_AMOUNT ? "Unbounded" : amt), - direction); - } - - public int compareTo(BoundarySpec other) - { - int c = direction.compareTo(other.getDirection()); - if (c != 0) { - return c; - } - - RangeBoundarySpec rb = (RangeBoundarySpec) other; - // Valid range is "range/rows between 10 preceding and 2 preceding" for preceding case - return this.direction == Direction.PRECEDING ? rb.amt - amt : amt - rb.amt; + public BoundarySpec() { } - } - - public static class CurrentRowSpec extends BoundarySpec - { - public CurrentRowSpec() { - } - - @Override - public String toString() - { - return "currentRow"; - } - - @Override - public Direction getDirection() { - return Direction.CURRENT; + public BoundarySpec(Direction direction) { + this(direction, 0); } - @Override - public void setDirection(Direction dir) {} - @Override - public void setAmt(int amt) {} - - public int compareTo(BoundarySpec other) + public BoundarySpec(Direction direction, int amt) { - return getDirection().compareTo(other.getDirection()); - } - - @Override - public int getAmt() {return 0;} - } - - public static class ValueBoundarySpec extends BoundarySpec - { - Direction direction; - int amt; - List orderExpressions; - - public ValueBoundarySpec() { - } - - public ValueBoundarySpec(Direction direction, int amt) - { - super(); this.direction = direction; this.amt = amt; } - @Override public Direction getDirection() { return direction; } - @Override public void setDirection(Direction direction) { this.direction = direction; } - public List getOrderExpressions() - { - return orderExpressions; - } - - public void setOrderExpressions(List orderExpressions) - { - this.orderExpressions = orderExpressions; - } - - @Override public int getAmt() { return amt; } - @Override public void setAmt(int amt) { this.amt = amt; @@ -734,16 +625,12 @@ public void setAmt(int amt) @Override public String toString() { - StringBuilder exprs = new StringBuilder(); - if (orderExpressions != null) { - for (int i=0; i p.size() ? p.size() : end; @@ -775,30 +750,38 @@ public Range(int start, int end, PTFPartition p) static abstract class ValueBoundaryScanner { - BoundaryDef bndDef; + BoundaryDef start, end; - public ValueBoundaryScanner(BoundaryDef bndDef) { - this.bndDef = bndDef; - } - - public void reset(BoundaryDef bndDef) { - this.bndDef = bndDef; + public ValueBoundaryScanner(BoundaryDef start, BoundaryDef end) { + this.start = start; + this.end = end; } protected abstract int computeStart(int rowIdx, PTFPartition p) throws HiveException; protected abstract int computeEnd(int rowIdx, PTFPartition p) throws HiveException; + + public static ValueBoundaryScanner getScanner(WindowFrameDef winFrameDef) + throws HiveException { + OrderDef orderDef = winFrameDef.getOrderDef(); + int numOrders = orderDef.getExpressions().size(); + if (numOrders != 1) { + return new MultiValueBoundaryScanner(winFrameDef.getStart(), winFrameDef.getEnd(), orderDef); + } else { + return SingleValueBoundaryScanner.getScanner(winFrameDef.getStart(), winFrameDef.getEnd(), orderDef); + } + } } /* * - starting from the given rowIdx scan in the given direction until a row's expr - * evaluates to an amt that crosses the 'amt' threshold specified in the ValueBoundaryDef. + * evaluates to an amt that crosses the 'amt' threshold specified in the BoundaryDef. */ static abstract class SingleValueBoundaryScanner extends ValueBoundaryScanner { OrderExpressionDef expressionDef; - public SingleValueBoundaryScanner(BoundaryDef bndDef, OrderExpressionDef expressionDef) { - super(bndDef); + public SingleValueBoundaryScanner(BoundaryDef start, BoundaryDef end, OrderExpressionDef expressionDef) { + super(start, end); this.expressionDef = expressionDef; } @@ -837,7 +820,7 @@ public SingleValueBoundaryScanner(BoundaryDef bndDef, OrderExpressionDef express */ @Override protected int computeStart(int rowIdx, PTFPartition p) throws HiveException { - switch(bndDef.getDirection()) { + switch(start.getDirection()) { case PRECEDING: return computeStartPreceding(rowIdx, p); case CURRENT: @@ -849,7 +832,7 @@ protected int computeStart(int rowIdx, PTFPartition p) throws HiveException { } protected int computeStartPreceding(int rowIdx, PTFPartition p) throws HiveException { - int amt = bndDef.getAmt(); + int amt = start.getAmt(); // Use Case 1. if ( amt == BoundarySpec.UNBOUNDED_AMOUNT ) { return 0; @@ -924,7 +907,7 @@ protected int computeStartCurrentRow(int rowIdx, PTFPartition p) throws HiveExce } protected int computeStartFollowing(int rowIdx, PTFPartition p) throws HiveException { - int amt = bndDef.getAmt(); + int amt = start.getAmt(); Object sortKey = computeValue(p.getAt(rowIdx)); Object rowVal = sortKey; @@ -1001,7 +984,7 @@ protected int computeStartFollowing(int rowIdx, PTFPartition p) throws HiveExcep */ @Override protected int computeEnd(int rowIdx, PTFPartition p) throws HiveException { - switch(bndDef.getDirection()) { + switch(end.getDirection()) { case PRECEDING: return computeEndPreceding(rowIdx, p); case CURRENT: @@ -1013,7 +996,7 @@ protected int computeEnd(int rowIdx, PTFPartition p) throws HiveException { } protected int computeEndPreceding(int rowIdx, PTFPartition p) throws HiveException { - int amt = bndDef.getAmt(); + int amt = end.getAmt(); // Use Case 1. // amt == UNBOUNDED, is caught during translation @@ -1081,7 +1064,7 @@ protected int computeEndCurrentRow(int rowIdx, PTFPartition p) throws HiveExcept } protected int computeEndFollowing(int rowIdx, PTFPartition p) throws HiveException { - int amt = bndDef.getAmt(); + int amt = end.getAmt(); // Use Case 8. if ( amt == BoundarySpec.UNBOUNDED_AMOUNT ) { @@ -1148,13 +1131,13 @@ public Object computeValue(Object row) throws HiveException { @SuppressWarnings("incomplete-switch") - public static SingleValueBoundaryScanner getScanner(ValueBoundaryDef vbDef) + public static SingleValueBoundaryScanner getScanner(BoundaryDef start, BoundaryDef end, OrderDef orderDef) throws HiveException { - if (vbDef.getOrderDef().getExpressions().size() != 1) { + if (orderDef.getExpressions().size() != 1) { throw new HiveException("Internal error: initializing SingleValueBoundaryScanner with" + " multiple expression for sorting"); } - OrderExpressionDef exprDef = vbDef.getOrderDef().getExpressions().get(0); + OrderExpressionDef exprDef = orderDef.getExpressions().get(0); PrimitiveObjectInspector pOI = (PrimitiveObjectInspector) exprDef.getOI(); switch(pOI.getPrimitiveCategory()) { case BYTE: @@ -1162,16 +1145,16 @@ public static SingleValueBoundaryScanner getScanner(ValueBoundaryDef vbDef) case LONG: case SHORT: case TIMESTAMP: - return new LongValueBoundaryScanner(vbDef, exprDef); + return new LongValueBoundaryScanner(start, end, exprDef); case DOUBLE: case FLOAT: - return new DoubleValueBoundaryScanner(vbDef, exprDef); + return new DoubleValueBoundaryScanner(start, end, exprDef); case DECIMAL: - return new HiveDecimalValueBoundaryScanner(vbDef, exprDef); + return new HiveDecimalValueBoundaryScanner(start, end, exprDef); case DATE: - return new DateValueBoundaryScanner(vbDef, exprDef); + return new DateValueBoundaryScanner(start, end, exprDef); case STRING: - return new StringValueBoundaryScanner(vbDef, exprDef); + return new StringValueBoundaryScanner(start, end, exprDef); } throw new HiveException( String.format("Internal Error: attempt to setup a Window for datatype %s", @@ -1180,8 +1163,8 @@ public static SingleValueBoundaryScanner getScanner(ValueBoundaryDef vbDef) } public static class LongValueBoundaryScanner extends SingleValueBoundaryScanner { - public LongValueBoundaryScanner(BoundaryDef bndDef, OrderExpressionDef expressionDef) { - super(bndDef,expressionDef); + public LongValueBoundaryScanner(BoundaryDef start, BoundaryDef end, OrderExpressionDef expressionDef) { + super(start, end,expressionDef); } @Override @@ -1212,8 +1195,8 @@ public boolean isEqual(Object v1, Object v2) { } public static class DoubleValueBoundaryScanner extends SingleValueBoundaryScanner { - public DoubleValueBoundaryScanner(BoundaryDef bndDef, OrderExpressionDef expressionDef) { - super(bndDef,expressionDef); + public DoubleValueBoundaryScanner(BoundaryDef start, BoundaryDef end, OrderExpressionDef expressionDef) { + super(start, end,expressionDef); } @Override @@ -1244,8 +1227,8 @@ public boolean isEqual(Object v1, Object v2) { } public static class HiveDecimalValueBoundaryScanner extends SingleValueBoundaryScanner { - public HiveDecimalValueBoundaryScanner(BoundaryDef bndDef, OrderExpressionDef expressionDef) { - super(bndDef,expressionDef); + public HiveDecimalValueBoundaryScanner(BoundaryDef start, BoundaryDef end, OrderExpressionDef expressionDef) { + super(start, end,expressionDef); } @Override @@ -1276,8 +1259,8 @@ public boolean isEqual(Object v1, Object v2) { } public static class DateValueBoundaryScanner extends SingleValueBoundaryScanner { - public DateValueBoundaryScanner(BoundaryDef bndDef, OrderExpressionDef expressionDef) { - super(bndDef,expressionDef); + public DateValueBoundaryScanner(BoundaryDef start, BoundaryDef end, OrderExpressionDef expressionDef) { + super(start, end,expressionDef); } @Override @@ -1303,8 +1286,8 @@ public boolean isEqual(Object v1, Object v2) { } public static class StringValueBoundaryScanner extends SingleValueBoundaryScanner { - public StringValueBoundaryScanner(BoundaryDef bndDef, OrderExpressionDef expressionDef) { - super(bndDef,expressionDef); + public StringValueBoundaryScanner(BoundaryDef start, BoundaryDef end, OrderExpressionDef expressionDef) { + super(start, end,expressionDef); } @Override @@ -1331,8 +1314,8 @@ public boolean isEqual(Object v1, Object v2) { static class MultiValueBoundaryScanner extends ValueBoundaryScanner { OrderDef orderDef; - public MultiValueBoundaryScanner(BoundaryDef bndDef, OrderDef orderDef) { - super(bndDef); + public MultiValueBoundaryScanner(BoundaryDef start, BoundaryDef end, OrderDef orderDef) { + super(start, end); this.orderDef = orderDef; } @@ -1349,7 +1332,7 @@ public MultiValueBoundaryScanner(BoundaryDef bndDef, OrderDef orderDef) { */ @Override protected int computeStart(int rowIdx, PTFPartition p) throws HiveException { - switch(bndDef.getDirection()) { + switch(start.getDirection()) { case PRECEDING: return computeStartPreceding(rowIdx, p); case CURRENT: @@ -1362,7 +1345,7 @@ protected int computeStart(int rowIdx, PTFPartition p) throws HiveException { } protected int computeStartPreceding(int rowIdx, PTFPartition p) throws HiveException { - int amt = bndDef.getAmt(); + int amt = start.getAmt(); if ( amt == BoundarySpec.UNBOUNDED_AMOUNT ) { return 0; } @@ -1397,7 +1380,7 @@ protected int computeStartCurrentRow(int rowIdx, PTFPartition p) throws HiveExce */ @Override protected int computeEnd(int rowIdx, PTFPartition p) throws HiveException { - switch(bndDef.getDirection()) { + switch(end.getDirection()) { case PRECEDING: throw new HiveException( "PRECEDING not allowed for finishing RANGE with multiple expressions in ORDER BY"); @@ -1424,7 +1407,7 @@ protected int computeEndCurrentRow(int rowIdx, PTFPartition p) throws HiveExcept } protected int computeEndFollowing(int rowIdx, PTFPartition p) throws HiveException { - int amt = bndDef.getAmt(); + int amt = end.getAmt(); if ( amt == BoundarySpec.UNBOUNDED_AMOUNT ) { return p.size(); } @@ -1458,15 +1441,6 @@ public boolean isEqual(Object[] v1, Object[] v2) { } return true; } - - public static MultiValueBoundaryScanner getScanner(ValueBoundaryDef vbDef) - throws HiveException { - if (vbDef.getOrderDef().getExpressions().size() <= 1) { - throw new HiveException("Internal error: initializing SingleValueBoundaryScanner with" - + " multiple expression for sorting"); - } - return new MultiValueBoundaryScanner(vbDef, vbDef.getOrderDef()); - } } public static class SameList extends AbstractList { diff --git a/ql/src/test/org/apache/hadoop/hive/ql/udaf/TestStreamingSum.java b/ql/src/test/org/apache/hadoop/hive/ql/udaf/TestStreamingSum.java index c26de3f..95e3176 100644 --- a/ql/src/test/org/apache/hadoop/hive/ql/udaf/TestStreamingSum.java +++ b/ql/src/test/org/apache/hadoop/hive/ql/udaf/TestStreamingSum.java @@ -28,9 +28,8 @@ import org.apache.hadoop.hive.ql.metadata.HiveException; import org.apache.hadoop.hive.ql.parse.WindowingSpec.BoundarySpec; import org.apache.hadoop.hive.ql.parse.WindowingSpec.Direction; +import org.apache.hadoop.hive.ql.parse.WindowingSpec.WindowType; import org.apache.hadoop.hive.ql.plan.ptf.BoundaryDef; -import org.apache.hadoop.hive.ql.plan.ptf.CurrentRowDef; -import org.apache.hadoop.hive.ql.plan.ptf.RangeBoundaryDef; import org.apache.hadoop.hive.ql.plan.ptf.WindowFrameDef; import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator; import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator.AggregationBuffer; @@ -52,18 +51,18 @@ public static WindowFrameDef wdwFrame(int p, int f) { BoundaryDef start, end; if (p == 0) { - start = new CurrentRowDef(); + start = new BoundaryDef(Direction.CURRENT, 0); } else { - start = new RangeBoundaryDef(Direction.PRECEDING, p); + start = new BoundaryDef(Direction.PRECEDING, p); } if (f == 0) { - end = new CurrentRowDef(); + end = new BoundaryDef(Direction.CURRENT, 0); } else { - end = new RangeBoundaryDef(Direction.FOLLOWING, f); + end = new BoundaryDef(Direction.FOLLOWING, f); } - return new WindowFrameDef(start, end); + return new WindowFrameDef(WindowType.ROWS, start, end); } public void sumDouble(Iterator inVals, int inSz, int numPreceding, diff --git a/ql/src/test/results/clientpositive/distinct_windowing.q.out b/ql/src/test/results/clientpositive/distinct_windowing.q.out index e6cde90..61ea8ee 100644 --- a/ql/src/test/results/clientpositive/distinct_windowing.q.out +++ b/ql/src/test/results/clientpositive/distinct_windowing.q.out @@ -91,7 +91,7 @@ STAGE PLANS: arguments: _col0 name: first_value window function: GenericUDAFFirstValueEvaluator - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 84795 Data size: 1017544 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: first_value_window_0 (type: tinyint) @@ -208,7 +208,7 @@ STAGE PLANS: arguments: _col2 name: last_value window function: GenericUDAFLastValueEvaluator - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 127193 Data size: 1017544 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: last_value_window_0 (type: int) @@ -330,13 +330,13 @@ STAGE PLANS: arguments: _col2 name: last_value window function: GenericUDAFLastValueEvaluator - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT window function definition alias: first_value_window_1 arguments: _col0 name: first_value window function: GenericUDAFFirstValueEvaluator - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 84795 Data size: 1017544 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: last_value_window_0 (type: int), first_value_window_1 (type: tinyint) diff --git a/ql/src/test/results/clientpositive/distinct_windowing_no_cbo.q.out b/ql/src/test/results/clientpositive/distinct_windowing_no_cbo.q.out index 0e9091e..29c53c2 100644 --- a/ql/src/test/results/clientpositive/distinct_windowing_no_cbo.q.out +++ b/ql/src/test/results/clientpositive/distinct_windowing_no_cbo.q.out @@ -91,7 +91,7 @@ STAGE PLANS: arguments: _col0 name: first_value window function: GenericUDAFFirstValueEvaluator - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 84795 Data size: 1017544 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: first_value_window_0 (type: tinyint) @@ -208,7 +208,7 @@ STAGE PLANS: arguments: _col2 name: last_value window function: GenericUDAFLastValueEvaluator - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 127193 Data size: 1017544 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: last_value_window_0 (type: int) @@ -330,13 +330,13 @@ STAGE PLANS: arguments: _col2 name: last_value window function: GenericUDAFLastValueEvaluator - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT window function definition alias: first_value_window_1 arguments: _col0 name: first_value window function: GenericUDAFFirstValueEvaluator - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 84795 Data size: 1017544 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: last_value_window_0 (type: int), first_value_window_1 (type: tinyint) diff --git a/ql/src/test/results/clientpositive/llap/ptf.q.out b/ql/src/test/results/clientpositive/llap/ptf.q.out index aabe694..b7a50e0 100644 --- a/ql/src/test/results/clientpositive/llap/ptf.q.out +++ b/ql/src/test/results/clientpositive/llap/ptf.q.out @@ -116,7 +116,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 12974 Basic stats: COMPLETE Column stats: COMPLETE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -611,7 +611,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 12974 Basic stats: COMPLETE Column stats: COMPLETE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -1674,7 +1674,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 12974 Basic stats: COMPLETE Column stats: COMPLETE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -1852,7 +1852,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 12974 Basic stats: COMPLETE Column stats: COMPLETE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -2091,7 +2091,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 12974 Basic stats: COMPLETE Column stats: COMPLETE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -2265,7 +2265,7 @@ STAGE PLANS: arguments: _col5 name: count window function: GenericUDAFCountEvaluator - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT window function definition alias: sum_window_1 arguments: _col7 @@ -2499,13 +2499,13 @@ STAGE PLANS: arguments: _col1 name: count window function: GenericUDAFCountEvaluator - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT window function definition alias: sum_window_3 arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT window function definition alias: lag_window_4 arguments: _col5, 1, _col5 @@ -3086,7 +3086,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 12974 Basic stats: COMPLETE Column stats: COMPLETE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -3539,7 +3539,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 12766 Basic stats: COMPLETE Column stats: COMPLETE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -3812,7 +3812,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 12766 Basic stats: COMPLETE Column stats: COMPLETE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -4060,7 +4060,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 12766 Basic stats: COMPLETE Column stats: COMPLETE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -4346,7 +4346,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 12766 Basic stats: COMPLETE Column stats: COMPLETE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -4613,7 +4613,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 12766 Basic stats: COMPLETE Column stats: COMPLETE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint), sum_window_2 (type: bigint) @@ -4867,7 +4867,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 12766 Basic stats: COMPLETE Column stats: COMPLETE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint), sum_window_2 (type: bigint) diff --git a/ql/src/test/results/clientpositive/llap/ptf_streaming.q.out b/ql/src/test/results/clientpositive/llap/ptf_streaming.q.out index 440b95d..d410f5d 100644 --- a/ql/src/test/results/clientpositive/llap/ptf_streaming.q.out +++ b/ql/src/test/results/clientpositive/llap/ptf_streaming.q.out @@ -116,7 +116,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 12974 Basic stats: COMPLETE Column stats: COMPLETE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -836,7 +836,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 12974 Basic stats: COMPLETE Column stats: COMPLETE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -1075,7 +1075,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 12974 Basic stats: COMPLETE Column stats: COMPLETE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -1316,7 +1316,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 12974 Basic stats: COMPLETE Column stats: COMPLETE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -1557,7 +1557,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 12974 Basic stats: COMPLETE Column stats: COMPLETE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -1779,13 +1779,13 @@ STAGE PLANS: arguments: _col1 name: count window function: GenericUDAFCountEvaluator - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT window function definition alias: sum_window_3 arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT window function definition alias: lag_window_4 arguments: _col5, 1, _col5 @@ -2060,7 +2060,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 12766 Basic stats: COMPLETE Column stats: COMPLETE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -2333,7 +2333,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 12766 Basic stats: COMPLETE Column stats: COMPLETE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -2589,7 +2589,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 12766 Basic stats: COMPLETE Column stats: COMPLETE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint), sum_window_2 (type: bigint) diff --git a/ql/src/test/results/clientpositive/llap/vectorized_ptf.q.out b/ql/src/test/results/clientpositive/llap/vectorized_ptf.q.out index 996b893..a5d5726 100644 --- a/ql/src/test/results/clientpositive/llap/vectorized_ptf.q.out +++ b/ql/src/test/results/clientpositive/llap/vectorized_ptf.q.out @@ -292,7 +292,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -1068,7 +1068,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -2693,7 +2693,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -2946,7 +2946,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -3264,7 +3264,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -3513,7 +3513,7 @@ STAGE PLANS: arguments: _col5 name: count window function: GenericUDAFCountEvaluator - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT window function definition alias: sum_window_1 arguments: _col7 @@ -3882,13 +3882,13 @@ STAGE PLANS: arguments: _col1 name: count window function: GenericUDAFCountEvaluator - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT window function definition alias: sum_window_3 arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT window function definition alias: lag_window_4 arguments: _col5, 1, _col5 @@ -4693,7 +4693,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -5297,7 +5297,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -5653,7 +5653,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -5980,7 +5980,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -6349,7 +6349,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -6695,7 +6695,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint), sum_window_2 (type: bigint) @@ -7028,7 +7028,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint), sum_window_2 (type: bigint) diff --git a/ql/src/test/results/clientpositive/ptf.q.out b/ql/src/test/results/clientpositive/ptf.q.out index cdac02a..e2956cd 100644 --- a/ql/src/test/results/clientpositive/ptf.q.out +++ b/ql/src/test/results/clientpositive/ptf.q.out @@ -115,7 +115,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -603,7 +603,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -1652,7 +1652,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -1829,7 +1829,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -2076,7 +2076,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -2249,7 +2249,7 @@ STAGE PLANS: arguments: _col5 name: count window function: GenericUDAFCountEvaluator - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT window function definition alias: sum_window_1 arguments: _col7 @@ -2487,13 +2487,13 @@ STAGE PLANS: arguments: _col1 name: count window function: GenericUDAFCountEvaluator - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT window function definition alias: sum_window_3 arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT window function definition alias: lag_window_4 arguments: _col5, 1, _col5 @@ -3070,7 +3070,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -3546,7 +3546,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -3836,7 +3836,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -4092,7 +4092,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -4395,7 +4395,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -4670,7 +4670,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint), sum_window_2 (type: bigint) @@ -4932,7 +4932,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint), sum_window_2 (type: bigint) diff --git a/ql/src/test/results/clientpositive/ptf_streaming.q.out b/ql/src/test/results/clientpositive/ptf_streaming.q.out index d1b49db..da5611d 100644 --- a/ql/src/test/results/clientpositive/ptf_streaming.q.out +++ b/ql/src/test/results/clientpositive/ptf_streaming.q.out @@ -115,7 +115,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -832,7 +832,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -1079,7 +1079,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -1328,7 +1328,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -1577,7 +1577,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -1803,13 +1803,13 @@ STAGE PLANS: arguments: _col1 name: count window function: GenericUDAFCountEvaluator - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT window function definition alias: sum_window_3 arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT window function definition alias: lag_window_4 arguments: _col5, 1, _col5 @@ -2092,7 +2092,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -2382,7 +2382,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -2646,7 +2646,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint), sum_window_2 (type: bigint) diff --git a/ql/src/test/results/clientpositive/spark/ptf.q.out b/ql/src/test/results/clientpositive/spark/ptf.q.out index fd3533c..d00cd8d 100644 --- a/ql/src/test/results/clientpositive/spark/ptf.q.out +++ b/ql/src/test/results/clientpositive/spark/ptf.q.out @@ -111,7 +111,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -589,7 +589,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -1618,7 +1618,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -1791,7 +1791,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -2024,7 +2024,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -2193,7 +2193,7 @@ STAGE PLANS: arguments: _col5 name: count window function: GenericUDAFCountEvaluator - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT window function definition alias: sum_window_1 arguments: _col7 @@ -2419,13 +2419,13 @@ STAGE PLANS: arguments: _col1 name: count window function: GenericUDAFCountEvaluator - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT window function definition alias: sum_window_3 arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT window function definition alias: lag_window_4 arguments: _col5, 1, _col5 @@ -2959,7 +2959,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -3449,7 +3449,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -3715,7 +3715,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -3957,7 +3957,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -4236,7 +4236,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -4497,7 +4497,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint), sum_window_2 (type: bigint) @@ -4745,7 +4745,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint), sum_window_2 (type: bigint) diff --git a/ql/src/test/results/clientpositive/spark/ptf_streaming.q.out b/ql/src/test/results/clientpositive/spark/ptf_streaming.q.out index 8e47b11..3947ff2 100644 --- a/ql/src/test/results/clientpositive/spark/ptf_streaming.q.out +++ b/ql/src/test/results/clientpositive/spark/ptf_streaming.q.out @@ -111,7 +111,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -806,7 +806,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -1039,7 +1039,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -1274,7 +1274,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -1509,7 +1509,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -1723,13 +1723,13 @@ STAGE PLANS: arguments: _col1 name: count window function: GenericUDAFCountEvaluator - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT window function definition alias: sum_window_3 arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT window function definition alias: lag_window_4 arguments: _col5, 1, _col5 @@ -1998,7 +1998,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -2264,7 +2264,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -2514,7 +2514,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint), sum_window_2 (type: bigint) diff --git a/ql/src/test/results/clientpositive/spark/union_remove_6_subq.q.out b/ql/src/test/results/clientpositive/spark/union_remove_6_subq.q.out index 10de07d..cebea03 100644 --- a/ql/src/test/results/clientpositive/spark/union_remove_6_subq.q.out +++ b/ql/src/test/results/clientpositive/spark/union_remove_6_subq.q.out @@ -455,7 +455,7 @@ STAGE PLANS: arguments: _col1 name: avg window function: GenericUDAFAverageEvaluatorDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col0 (type: string), avg_window_0 (type: double) diff --git a/ql/src/test/results/clientpositive/spark/vectorized_ptf.q.out b/ql/src/test/results/clientpositive/spark/vectorized_ptf.q.out index 2ab2541..1b85aa9 100644 --- a/ql/src/test/results/clientpositive/spark/vectorized_ptf.q.out +++ b/ql/src/test/results/clientpositive/spark/vectorized_ptf.q.out @@ -288,7 +288,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -1050,7 +1050,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -2645,7 +2645,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -2894,7 +2894,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -3207,7 +3207,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -3452,7 +3452,7 @@ STAGE PLANS: arguments: _col5 name: count window function: GenericUDAFCountEvaluator - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT window function definition alias: sum_window_1 arguments: _col7 @@ -3814,13 +3814,13 @@ STAGE PLANS: arguments: _col1 name: count window function: GenericUDAFCountEvaluator - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT window function definition alias: sum_window_3 arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT window function definition alias: lag_window_4 arguments: _col5, 1, _col5 @@ -4575,7 +4575,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -5225,7 +5225,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -5575,7 +5575,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -5897,7 +5897,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -6260,7 +6260,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -6601,7 +6601,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint), sum_window_2 (type: bigint) @@ -6929,7 +6929,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint), sum_window_2 (type: bigint) diff --git a/ql/src/test/results/clientpositive/subquery_in_having.q.out b/ql/src/test/results/clientpositive/subquery_in_having.q.out index e277c59..1ab7e7f 100644 --- a/ql/src/test/results/clientpositive/subquery_in_having.q.out +++ b/ql/src/test/results/clientpositive/subquery_in_having.q.out @@ -1504,7 +1504,7 @@ STAGE PLANS: arguments: _col1 name: first_value window function: GenericUDAFFirstValueEvaluator - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 15 Data size: 3173 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: first_value_window_0 (type: string) diff --git a/ql/src/test/results/clientpositive/union_remove_6_subq.q.out b/ql/src/test/results/clientpositive/union_remove_6_subq.q.out index 6439a0f..7b306ed 100644 --- a/ql/src/test/results/clientpositive/union_remove_6_subq.q.out +++ b/ql/src/test/results/clientpositive/union_remove_6_subq.q.out @@ -545,7 +545,7 @@ STAGE PLANS: arguments: _col1 name: avg window function: GenericUDAFAverageEvaluatorDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col0 (type: string), avg_window_0 (type: double) diff --git a/ql/src/test/results/clientpositive/vectorized_ptf.q.out b/ql/src/test/results/clientpositive/vectorized_ptf.q.out index 7fb966a..254ca24 100644 --- a/ql/src/test/results/clientpositive/vectorized_ptf.q.out +++ b/ql/src/test/results/clientpositive/vectorized_ptf.q.out @@ -329,7 +329,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -1161,7 +1161,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -2988,7 +2988,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -3278,7 +3278,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -3679,7 +3679,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -3965,7 +3965,7 @@ STAGE PLANS: arguments: _col5 name: count window function: GenericUDAFCountEvaluator - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT window function definition alias: sum_window_1 arguments: _col7 @@ -4408,13 +4408,13 @@ STAGE PLANS: arguments: _col1 name: count window function: GenericUDAFCountEvaluator - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT window function definition alias: sum_window_3 arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT window function definition alias: lag_window_4 arguments: _col5, 1, _col5 @@ -5337,7 +5337,7 @@ STAGE PLANS: arguments: _col7 name: sum window function: GenericUDAFSumDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), _col5 (type: int), rank_window_0 (type: int), dense_rank_window_1 (type: int), sum_window_2 (type: double) @@ -6105,7 +6105,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -6590,7 +6590,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -7000,7 +7000,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -7498,7 +7498,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint) @@ -7927,7 +7927,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint), sum_window_2 (type: bigint) @@ -8343,7 +8343,7 @@ STAGE PLANS: arguments: _col5 name: sum window function: GenericUDAFSumLong - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 26 Data size: 16042 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col2 (type: string), _col1 (type: string), rank_window_0 (type: int), dense_rank_window_1 (type: int), _col5 (type: int), sum_window_2 (type: bigint), sum_window_2 (type: bigint) diff --git a/ql/src/test/results/clientpositive/windowing_gby2.q.out b/ql/src/test/results/clientpositive/windowing_gby2.q.out index 4bd6994..adb3296 100644 --- a/ql/src/test/results/clientpositive/windowing_gby2.q.out +++ b/ql/src/test/results/clientpositive/windowing_gby2.q.out @@ -211,7 +211,7 @@ STAGE PLANS: arguments: _col0 name: avg window function: GenericUDAFAverageEvaluatorDouble - window frame: PRECEDING(MAX)~ + window frame: PRECEDING(MAX)~CURRENT Statistics: Num rows: 10 Data size: 131 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: avg_window_0 (type: double)