presto-memory/src/main/java/io/prestosql/plugin/memory/MemoryMetadata.java/MemoryMetadata/applyLimit
class MemoryMetadata:    @Override
    public Optional<LimitApplicationResult<ConnectorTableHandle>> applyLimit(ConnectorSession session, ConnectorTableHandle handle, long limit)
    {
        MemoryTableHandle table = (MemoryTableHandle) handle;

        if (table.getLimit().isPresent() && table.getLimit().getAsLong() <= limit) {
            return Optional.empty();
        }

        return Optional.of(new LimitApplicationResult<>(
                new MemoryTableHandle(table.getId(), OptionalLong.of(limit), OptionalDouble.empty()),
                true));
    }