Implement pagination like flink app