presto-main/src/main/java/io/prestosql/sql/ParameterUtils.java/ParameterUtils/parameterExtractor
class ParameterUtils:    public static Map<NodeRef<Parameter>, Expression> parameterExtractor(Statement statement, List<Expression> parameters)
    {
        List<Parameter> parametersList = getParameters(statement).stream()
                .sorted(Comparator.comparing(
                        parameter -> parameter.getLocation().get(),
                        Comparator.comparing(NodeLocation::getLineNumber)
                                .thenComparing(NodeLocation::getColumnNumber)))
                .collect(toImmutableList());

        ImmutableMap.Builder<NodeRef<Parameter>, Expression> builder = ImmutableMap.builder();
        Iterator<Expression> iterator = parameters.iterator();
        for (Parameter parameter : parametersList) {
            builder.put(NodeRef.of(parameter), iterator.next());
        }
        return builder.build();
    }