use of com.yahoo.document.DataType in project vespa by vespa-engine.
the class ToArrayExpression method doExecute.
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
protected void doExecute(ExecutionContext ctx) {
FieldValue input = ctx.getValue();
DataType inputType = input.getDataType();
ArrayDataType outputType = DataType.getArray(inputType);
Array output = outputType.createFieldValue();
output.add(input);
ctx.setValue(output);
}
use of com.yahoo.document.DataType in project vespa by vespa-engine.
the class ToWsetExpression method doExecute.
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
protected void doExecute(ExecutionContext ctx) {
FieldValue input = ctx.getValue();
DataType inputType = input.getDataType();
WeightedSetDataType outputType = DataType.getWeightedSet(inputType, createIfNonExistent, removeIfZero);
WeightedSet output = outputType.createFieldValue();
output.add(input);
ctx.setValue(output);
}
Aggregations