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(); }