RestRepository client = new RestRepository(settings);
Field mapping = client.getMapping();
Collection<String> fields = CascadingUtils.fieldToAlias(settings, getSourceFields());
// validate if possible
FieldPresenceValidation validation = settings.getFieldExistanceValidation();
if (validation.isRequired()) {
MappingUtils.validateMapping(fields, mapping, validation, log);
}
input = QueryBuilder.query(settings).fields(StringUtils.concatenateAndUriEncode(fields, ",")).build(client,
new ScrollReader(new JdkValueReader(), mapping, settings.getReadMetadata(), settings.getReadMetadataField()));