presto-main/src/main/java/io/prestosql/split/SampledSplitSource.java/SampledSplitSource/getNextBatch
class SampledSplitSource:    @Override
    public ListenableFuture<SplitBatch> getNextBatch(ConnectorPartitionHandle partitionHandle, Lifespan lifespan, int maxSize)
    {
        ListenableFuture<SplitBatch> batch = splitSource.getNextBatch(partitionHandle, lifespan, maxSize);
        return Futures.transform(batch, splitBatch -> new SplitBatch(
                splitBatch.getSplits().stream()
                        .filter(input -> ThreadLocalRandom.current().nextDouble() < sampleRatio)
                        .collect(toImmutableList()),
                splitBatch.isLastBatch()), directExecutor());
    }