@Override public TupleBuffer getBufferDirect(int maxRows) throws BlockedException, TeiidComponentException, TeiidProcessingException { if (maxRows >= 0) { if (limit >= 0) { maxRows = Math.min(maxRows, limit); } } else { maxRows = limit; } return this.getChildren()[0].getBuffer(maxRows); }
@Override public boolean hasBuffer() { //TODO: support offset return offsetExpr == null && this.getChildren()[0].hasBuffer(); }
@Override public TupleBuffer getBufferDirect(int maxRows) throws BlockedException, TeiidComponentException, TeiidProcessingException { if (maxRows >= 0) { if (limit >= 0) { maxRows = Math.min(maxRows, limit); } } else { maxRows = limit; } return this.getChildren()[0].getBuffer(maxRows); }
@Override public boolean hasBuffer() { //TODO: support offset return offsetExpr == null && this.getChildren()[0].hasBuffer(); }
@Override public boolean hasBuffer() { //TODO: support offset return offsetExpr == null && this.getChildren()[0].hasBuffer(); }
@Override public TupleBuffer getBufferDirect(int maxRows) throws BlockedException, TeiidComponentException, TeiidProcessingException { if (maxRows >= 0) { if (limit >= 0) { maxRows = Math.min(maxRows, limit); } } else { maxRows = limit; } return this.getChildren()[0].getBuffer(maxRows); }
public static AccessNode getAccessNode(ProcessorPlan plan) { if(!(plan instanceof RelationalPlan)) { return null; } RelationalPlan rplan = (RelationalPlan) plan; // Check that the plan is just an access node RelationalNode accessNode = rplan.getRootNode(); if (accessNode instanceof LimitNode) { LimitNode ln = (LimitNode)accessNode; if (!ln.isImplicit()) { return null; } accessNode = ln.getChildren()[0]; } if (! (accessNode instanceof AccessNode)) { return null; } return (AccessNode)accessNode; }
public static AccessNode getAccessNode(ProcessorPlan plan) { if(!(plan instanceof RelationalPlan)) { return null; } RelationalPlan rplan = (RelationalPlan) plan; // Check that the plan is just an access node RelationalNode accessNode = rplan.getRootNode(); if (accessNode instanceof LimitNode) { LimitNode ln = (LimitNode)accessNode; if (!ln.isImplicit()) { return null; } accessNode = ln.getChildren()[0]; } if (! (accessNode instanceof AccessNode)) { return null; } return (AccessNode)accessNode; }
public static AccessNode getAccessNode(ProcessorPlan plan) { if(!(plan instanceof RelationalPlan)) { return null; } RelationalPlan rplan = (RelationalPlan) plan; // Check that the plan is just an access node RelationalNode accessNode = rplan.getRootNode(); if (accessNode instanceof LimitNode) { LimitNode ln = (LimitNode)accessNode; if (!ln.isImplicit()) { return null; } accessNode = ln.getChildren()[0]; } if (! (accessNode instanceof AccessNode)) { return null; } return (AccessNode)accessNode; }
public void open() throws TeiidComponentException, TeiidProcessingException { limit = -1; if (limitExpr != null) { Integer limitVal = (Integer)new Evaluator(Collections.emptyMap(), getDataManager(), getContext()).evaluate(limitExpr, Collections.emptyList()); ValidationVisitor.LIMIT_CONSTRAINT.validate(limitVal); limit = limitVal.intValue(); } if (limit == 0) { return; } if (offsetExpr != null) { Integer offsetVal = (Integer)new Evaluator(Collections.emptyMap(), getDataManager(), getContext()).evaluate(offsetExpr, Collections.emptyList()); ValidationVisitor.LIMIT_CONSTRAINT.validate(offsetVal); offset = offsetVal.intValue(); } else { offset = 0; } offsetPhase = offset > 0; if (limit > -1 && this.getChildren()[0] instanceof SortNode) { ((SortNode)this.getChildren()[0]).setRowLimit((int) Math.min(Integer.MAX_VALUE, (long)limit + offset)); } super.open(); }
public void open() throws TeiidComponentException, TeiidProcessingException { limit = -1; if (limitExpr != null) { Integer limitVal = (Integer)new Evaluator(Collections.emptyMap(), getDataManager(), getContext()).evaluate(limitExpr, Collections.emptyList()); ValidationVisitor.LIMIT_CONSTRAINT.validate(limitVal); limit = limitVal.intValue(); } if (limit == 0) { return; } if (offsetExpr != null) { Integer offsetVal = (Integer)new Evaluator(Collections.emptyMap(), getDataManager(), getContext()).evaluate(offsetExpr, Collections.emptyList()); ValidationVisitor.LIMIT_CONSTRAINT.validate(offsetVal); offset = offsetVal.intValue(); } else { offset = 0; } offsetPhase = offset > 0; if (limit > -1 && this.getChildren()[0] instanceof SortNode) { ((SortNode)this.getChildren()[0]).setRowLimit((int) Math.min(Integer.MAX_VALUE, (long)limit + offset)); } super.open(); }
public void open() throws TeiidComponentException, TeiidProcessingException { limit = -1; if (limitExpr != null) { Integer limitVal = (Integer)new Evaluator(Collections.emptyMap(), getDataManager(), getContext()).evaluate(limitExpr, Collections.emptyList()); ValidationVisitor.LIMIT_CONSTRAINT.validate(limitVal); limit = limitVal.intValue(); } if (limit == 0) { return; } if (offsetExpr != null) { Integer offsetVal = (Integer)new Evaluator(Collections.emptyMap(), getDataManager(), getContext()).evaluate(offsetExpr, Collections.emptyList()); ValidationVisitor.LIMIT_CONSTRAINT.validate(offsetVal); offset = offsetVal.intValue(); } else { offset = 0; } offsetPhase = offset > 0; if (limit > -1 && this.getChildren()[0] instanceof SortNode) { ((SortNode)this.getChildren()[0]).setRowLimit((int) Math.min(Integer.MAX_VALUE, (long)limit + offset)); } super.open(); }
batch = getChildren()[0].nextBatch(); // Can throw BlockedException rowCounter += batch.getRowCount(); if (batch.getTerminationFlag()) { rowCounter = 0; } else { batch = getChildren()[0].nextBatch(); // Can throw BlockedException
batch = getChildren()[0].nextBatch(); // Can throw BlockedException rowCounter += batch.getRowCount(); if (batch.getTerminationFlag()) { rowCounter = 0; } else { batch = getChildren()[0].nextBatch(); // Can throw BlockedException
batch = getChildren()[0].nextBatch(); // Can throw BlockedException rowCounter += batch.getRowCount(); if (batch.getTerminationFlag()) { rowCounter = 0; } else { batch = getChildren()[0].nextBatch(); // Can throw BlockedException