use of io.ordinate.engine.function.IntFunction in project Mycat2 by MyCATApache.
the class CalciteCompiler method convertLimit.
public PhysicalPlan convertLimit(PhysicalPlan input, RexNode offset, RexNode fetch) {
IntFunction offsetFunction = Optional.ofNullable(offset).map(i -> {
return (IntFunction) rexConverter.convertRex(offset, input.schema());
}).orElse(IntConstant.newInstance(0));
IntFunction fetchFunction = Optional.ofNullable(fetch).map((i) -> (IntFunction) rexConverter.convertRex(fetch, input.schema())).orElse(IntConstant.newInstance(Integer.MAX_VALUE));
return LimitPlan.create(input, offsetFunction, fetchFunction);
}
Aggregations