public boolean isUnbounded() { return this.getAmt() == BoundarySpec.UNBOUNDED_AMOUNT; }
public boolean isUnbounded() { return this.getAmt() == BoundarySpec.UNBOUNDED_AMOUNT; }
public WindowFrameDef(WindowType windowType, BoundaryDef start, BoundaryDef end) { this.windowType = windowType; this.start = start; this.end = end; // Calculate window size if (start.getDirection() == end.getDirection()) { windowSize = Math.abs(end.getAmt() - start.getAmt()) + 1; } else { windowSize = end.getAmt() + start.getAmt() + 1; } }
public WindowFrameDef(WindowType windowType, BoundaryDef start, BoundaryDef end) { this.windowType = windowType; this.start = start; this.end = end; // Calculate window size if (start.getDirection() == end.getDirection()) { windowSize = Math.abs(end.getAmt() - start.getAmt()) + 1; } else { windowSize = end.getAmt() + start.getAmt() + 1; } }
protected int computeStartPreceding(int rowIdx, PTFPartition p) throws HiveException { int amt = start.getAmt(); if ( amt == BoundarySpec.UNBOUNDED_AMOUNT ) { return 0; } throw new HiveException( "PRECEDING needs UNBOUNDED for RANGE with multiple expressions in ORDER BY"); }
protected int computeStartPreceding(int rowIdx, PTFPartition p) throws HiveException { int amt = start.getAmt(); if ( amt == BoundarySpec.UNBOUNDED_AMOUNT ) { return 0; } throw new HiveException( "PRECEDING needs UNBOUNDED for RANGE with multiple expressions in ORDER BY"); }
protected int computeEndFollowing(int rowIdx, PTFPartition p) throws HiveException { int amt = end.getAmt(); if ( amt == BoundarySpec.UNBOUNDED_AMOUNT ) { return p.size(); } throw new HiveException( "FOLLOWING needs UNBOUNDED for RANGE with multiple expressions in ORDER BY"); }
protected int computeEndFollowing(int rowIdx, PTFPartition p) throws HiveException { int amt = end.getAmt(); if ( amt == BoundarySpec.UNBOUNDED_AMOUNT ) { return p.size(); } throw new HiveException( "FOLLOWING needs UNBOUNDED for RANGE with multiple expressions in ORDER BY"); }
private static int getRowBoundaryStart(BoundaryDef b, int currRow) throws HiveException { Direction d = b.getDirection(); int amt = b.getAmt(); switch(d) { case PRECEDING: if (amt == BoundarySpec.UNBOUNDED_AMOUNT) { return 0; } else { return currRow - amt; } case CURRENT: return currRow; case FOLLOWING: return currRow + amt; } throw new HiveException("Unknown Start Boundary Direction: " + d); }
private static int getRowBoundaryStart(BoundaryDef b, int currRow) throws HiveException { Direction d = b.getDirection(); int amt = b.getAmt(); switch(d) { case PRECEDING: if (amt == BoundarySpec.UNBOUNDED_AMOUNT) { return 0; } else { return currRow - amt; } case CURRENT: return currRow; case FOLLOWING: return currRow + amt; } throw new HiveException("Unknown Start Boundary Direction: " + d); }
private static int getRowBoundaryEnd(BoundaryDef b, int currRow, PTFPartition p) throws HiveException { Direction d = b.getDirection(); int amt = b.getAmt(); switch(d) { case PRECEDING: if ( amt == 0 ) { return currRow + 1; } return currRow - amt + 1; case CURRENT: return currRow + 1; case FOLLOWING: if (amt == BoundarySpec.UNBOUNDED_AMOUNT) { return p.size(); } else { return currRow + amt + 1; } } throw new HiveException("Unknown End Boundary Direction: " + d); }
private static int getRowBoundaryEnd(BoundaryDef b, int currRow, PTFPartition p) throws HiveException { Direction d = b.getDirection(); int amt = b.getAmt(); switch(d) { case PRECEDING: if ( amt == 0 ) { return currRow + 1; } return currRow - amt + 1; case CURRENT: return currRow + 1; case FOLLOWING: if (amt == BoundarySpec.UNBOUNDED_AMOUNT) { return p.size(); } else { return currRow + amt + 1; } } throw new HiveException("Unknown End Boundary Direction: " + d); }
protected int computeEndPreceding(int rowIdx, PTFPartition p) throws HiveException { int amt = end.getAmt();
protected int computeStartFollowing(int rowIdx, PTFPartition p) throws HiveException { int amt = start.getAmt(); Object sortKey = computeValue(p.getAt(rowIdx));
protected int computeEndFollowing(int rowIdx, PTFPartition p) throws HiveException { int amt = end.getAmt();