public OrderDef(PartitionDef pDef) { for(PTFExpressionDef eDef : pDef.getExpressions()) { addExpression(new OrderExpressionDef(eDef)); } }
public PTFExpressionDef(PTFExpressionDef e) { expressionTreeString = e.getExpressionTreeString(); exprNode = e.getExprNode(); exprEvaluator = e.getExprEvaluator(); OI = e.getOI(); }
private ShapeDetails copyShape(ShapeDetails src) { ShapeDetails dest = new ShapeDetails(); dest.setSerdeClassName(src.getSerdeClassName()); dest.setSerdeProps(src.getSerdeProps()); dest.setColumnNames(src.getColumnNames()); dest.setOI(src.getOI()); dest.setSerde(src.getSerde()); dest.setRr(src.getRr()); dest.setTypeCheckCtx(src.getTypeCheckCtx()); return dest; }
private boolean canPushLimitToReduceSink(WindowTableFunctionDef wTFn) { for(WindowFunctionDef wFnDef : wTFn.getWindowFunctions() ) { if ( (wFnDef.getWFnEval() instanceof GenericUDAFRankEvaluator) || (wFnDef.getWFnEval() instanceof GenericUDAFDenseRankEvaluator ) || (wFnDef.getWFnEval() instanceof GenericUDAFLeadEvaluator ) ) { continue; } WindowFrameDef wdwFrame = wFnDef.getWindowFrame(); BoundaryDef end = wdwFrame.getEnd(); if (wdwFrame.getWindowType() == WindowType.RANGE) { return false; } if ( end.getDirection() == Direction.FOLLOWING ) { return false; } } return true; }
@Override public void setupOutputOI() throws SemanticException { StructObjectInspector OI = getEvaluator().getTableDef().getInput().getOutputShape().getOI(); setOutputOI(OI); }
protected void initialize(WindowFrameDef winFrame, ShapeDetails inpShape) throws HiveException { if (winFrame.getWindowType() == WindowType.RANGE) { for (OrderExpressionDef exprDef : winFrame.getOrderDef().getExpressions()) { initialize(exprDef, inpShape); } } }
public static WindowFrameDef wdwFrame(int p, int f) { BoundaryDef start, end; if (p == 0) { start = new BoundaryDef(Direction.CURRENT, 0); } else { start = new BoundaryDef(Direction.PRECEDING, p); } if (f == 0) { end = new BoundaryDef(Direction.CURRENT, 0); } else { end = new BoundaryDef(Direction.FOLLOWING, f); } return new WindowFrameDef(WindowType.ROWS, start, end); }
/** * Gets the next row index that the data within the window are available and can be processed * @param wFrameDef * @return */ public int rowToProcess(WindowFrameDef wFrameDef) { int rowToProcess = numRowsReceived - 1 - Math.max(0, wFrameDef.getEnd().getRelativeOffset()); return rowToProcess >= 0 ? rowToProcess : -1; }
public PartitionedTableFunctionDef getStartOfChain() { if (input instanceof PartitionedTableFunctionDef ) { return ((PartitionedTableFunctionDef)input).getStartOfChain(); } return this; }
public boolean isUnbounded() { return this.getAmt() == BoundarySpec.UNBOUNDED_AMOUNT; }
public boolean forNoop() { return funcDef.getTFunction() instanceof Noop; }
public boolean isStartUnbounded() { return start.isUnbounded(); }
private ShapeDetails copyShape(ShapeDetails src) { ShapeDetails dest = new ShapeDetails(); dest.setSerdeClassName(src.getSerdeClassName()); dest.setSerdeProps(src.getSerdeProps()); dest.setColumnNames(src.getColumnNames()); dest.setOI(src.getOI()); dest.setSerde(src.getSerde()); dest.setRr(src.getRr()); dest.setTypeCheckCtx(src.getTypeCheckCtx()); return dest; }
public PTFExpressionDef(PTFExpressionDef e) { expressionTreeString = e.getExpressionTreeString(); exprNode = e.getExprNode(); exprEvaluator = e.getExprEvaluator(); OI = e.getOI(); }
@Override public void setupRawInputOI() throws SemanticException { StructObjectInspector OI = getEvaluator().getTableDef().getInput().getOutputShape().getOI(); setRawInputOI(OI); }
public OrderDef(PartitionDef pDef) { for(PTFExpressionDef eDef : pDef.getExpressions()) { addExpression(new OrderExpressionDef(eDef)); } }
public PartitionedTableFunctionDef getStartOfChain() { if (input instanceof PartitionedTableFunctionDef ) { return ((PartitionedTableFunctionDef)input).getStartOfChain(); } return this; }
@Override public void setupOutputOI() throws SemanticException { StructObjectInspector OI = getEvaluator().getTableDef().getInput().getOutputShape().getOI(); setOutputOI(OI); }