presto-base-jdbc/src/main/java/io/prestosql/plugin/jdbc/BaseJdbcClient.java/BaseJdbcClient/tryApplyLimit
class BaseJdbcClient:    protected Function<String, String> tryApplyLimit(OptionalLong limit)
    {
        if (!limit.isPresent()) {
            return Function.identity();
        }
        return limitFunction()
                .map(limitFunction -> (Function<String, String>) sql -> limitFunction.apply(sql, limit.getAsLong()))
                .orElseGet(Function::identity);
    }