use of com.hazelcast.sql.impl.extract.GenericQueryTarget in project hazelcast by hazelcast.
the class KvRowProjectorTest method test_project_onlyDataKeyAndValueIsProvided.
@Test
public void test_project_onlyDataKeyAndValueIsProvided() {
InternalSerializationService serializationService = new DefaultSerializationServiceBuilder().build();
KvRowProjector projector = new KvRowProjector(new QueryPath[] { QueryPath.KEY_PATH, QueryPath.VALUE_PATH }, new QueryDataType[] { INT, INT }, new GenericQueryTarget(serializationService, null, true), new GenericQueryTarget(serializationService, null, false), null, asList(MultiplyFunction.create(ColumnExpression.create(0, INT), ConstantExpression.create(2, INT), INT), DivideFunction.create(ColumnExpression.create(1, INT), ConstantExpression.create(2, INT), INT)), SqlTestSupport.createExpressionEvalContext());
JetSqlRow row = projector.project(serializationService.toData(1), serializationService.toData(8));
assertThat(row).isEqualTo(jetRow(2, 4));
}
Aggregations