Search in sources :

Example 56 with DataType

use of com.yahoo.document.DataType in project vespa by vespa-engine.

the class IfThenExpression method doVerify.

@Override
protected void doVerify(VerificationContext context) {
    DataType input = context.getValue();
    context.setValue(input).execute(lhs);
    context.setValue(input).execute(rhs);
    context.setValue(input).execute(ifTrue);
    context.setValue(input).execute(ifFalse);
    context.setValue(input);
}
Also used : DataType(com.yahoo.document.DataType)

Example 57 with DataType

use of com.yahoo.document.DataType in project vespa by vespa-engine.

the class IfThenExpression method requiredInputType.

@Override
public DataType requiredInputType() {
    DataType input = null;
    input = resolveRequiredInputType(input, lhs.requiredInputType());
    input = resolveRequiredInputType(input, rhs.requiredInputType());
    input = resolveRequiredInputType(input, ifTrue.requiredInputType());
    if (ifFalse != null) {
        input = resolveRequiredInputType(input, ifFalse.requiredInputType());
    }
    return input;
}
Also used : DataType(com.yahoo.document.DataType)

Example 58 with DataType

use of com.yahoo.document.DataType in project vespa by vespa-engine.

the class JoinExpression method doVerify.

@Override
protected void doVerify(VerificationContext context) {
    DataType input = context.getValue();
    if (!(input instanceof ArrayDataType)) {
        throw new VerificationException(this, "Expected Array input, got " + input.getName() + ".");
    }
    context.setValue(createdOutputType());
}
Also used : DataType(com.yahoo.document.DataType) ArrayDataType(com.yahoo.document.ArrayDataType) ArrayDataType(com.yahoo.document.ArrayDataType)

Example 59 with DataType

use of com.yahoo.document.DataType in project vespa by vespa-engine.

the class ScriptExpression method doVerify.

@Override
protected void doVerify(VerificationContext context) {
    DataType input = context.getValue();
    for (Expression exp : this) {
        context.setValue(input).execute(exp);
    }
    context.setValue(input);
}
Also used : DataType(com.yahoo.document.DataType)

Example 60 with DataType

use of com.yahoo.document.DataType in project vespa by vespa-engine.

the class SetVarExpression method doVerify.

@Override
protected void doVerify(VerificationContext context) {
    DataType next = context.getValue();
    DataType prev = context.getVariable(varName);
    if (prev != null && !prev.equals(next)) {
        throw new VerificationException(this, "Attempting to assign conflicting types to variable '" + varName + "', " + prev.getName() + " vs " + next.getName() + ".");
    }
    context.setVariable(varName, next);
}
Also used : DataType(com.yahoo.document.DataType)

Aggregations

DataType (com.yahoo.document.DataType)62 ArrayDataType (com.yahoo.document.ArrayDataType)20 MapDataType (com.yahoo.document.MapDataType)19 Field (com.yahoo.document.Field)17 StructDataType (com.yahoo.document.StructDataType)17 WeightedSetDataType (com.yahoo.document.WeightedSetDataType)17 ReferenceDataType (com.yahoo.document.ReferenceDataType)13 PositionDataType (com.yahoo.document.PositionDataType)12 CollectionDataType (com.yahoo.document.CollectionDataType)11 FieldValue (com.yahoo.document.datatypes.FieldValue)11 TensorDataType (com.yahoo.document.TensorDataType)10 DocumentType (com.yahoo.document.DocumentType)9 StructuredDataType (com.yahoo.document.StructuredDataType)7 CollectionFieldValue (com.yahoo.document.datatypes.CollectionFieldValue)6 SDField (com.yahoo.searchdefinition.document.SDField)6 MapFieldValue (com.yahoo.document.datatypes.MapFieldValue)5 TemporaryStructuredDataType (com.yahoo.document.TemporaryStructuredDataType)4 AnnotationReferenceDataType (com.yahoo.document.annotation.AnnotationReferenceDataType)4 IntegerFieldValue (com.yahoo.document.datatypes.IntegerFieldValue)4 StringFieldValue (com.yahoo.document.datatypes.StringFieldValue)4