use of com.yahoo.vespa.indexinglanguage.expressions.VerificationException in project vespa by vespa-engine.
the class SimpleDocumentAdapter method tryOutputType.
@Override
public void tryOutputType(Expression exp, String fieldName, DataType valueType) {
Field field = output.getDataType().getField(fieldName);
if (field == null) {
throw new VerificationException(exp, "Field '" + fieldName + "' not found.");
}
DataType fieldType = field.getDataType();
if (!fieldType.isAssignableFrom(valueType)) {
throw new VerificationException(exp, "Can not assign " + valueType.getName() + " to field '" + fieldName + "' which is " + fieldType.getName() + ".");
}
}
Aggregations