use of com.hazelcast.jet.sql.SqlTestSupport in project hazelcast by hazelcast.
the class JoinByPrimitiveKeyProcessorTest method runTest.
private void runTest(Expression<Boolean> rowProjectorCondition, Expression<?> rowProjectorProjection, Expression<Boolean> joinCondition, boolean inner, List<JetSqlRow> input, List<JetSqlRow> output) {
KvRowProjector.Supplier projectorSupplier = KvRowProjector.supplier(new QueryPath[] { QueryPath.KEY_PATH, QueryPath.VALUE_PATH }, new QueryDataType[] { QueryDataType.INT, VARCHAR }, GenericQueryTargetDescriptor.DEFAULT, GenericQueryTargetDescriptor.DEFAULT, rowProjectorCondition, singletonList(rowProjectorProjection));
ProcessorSupplier processor = new JoinByPrimitiveKeyProcessorSupplier(inner, 0, joinCondition, MAP_NAME, projectorSupplier);
TestSupport.verifyProcessor(adaptSupplier(processor)).jobConfig(new JobConfig().setArgument(SQL_ARGUMENTS_KEY_NAME, emptyList())).input(input).hazelcastInstance(instance()).outputChecker(SqlTestSupport::compareRowLists).disableProgressAssertion().expectOutput(output);
}
use of com.hazelcast.jet.sql.SqlTestSupport in project hazelcast by hazelcast.
the class JoinByEquiJoinProcessorTest method runTest.
private void runTest(JoinRelType joinType, Expression<Boolean> rowProjectorCondition, Expression<?> rowProjectorProjection, Expression<Boolean> nonEquiCondition, List<JetSqlRow> input, List<JetSqlRow> output) {
KvRowProjector.Supplier projectorSupplier = KvRowProjector.supplier(new QueryPath[] { QueryPath.KEY_PATH, QueryPath.VALUE_PATH }, new QueryDataType[] { QueryDataType.INT, VARCHAR }, GenericQueryTargetDescriptor.DEFAULT, GenericQueryTargetDescriptor.DEFAULT, rowProjectorCondition, singletonList(rowProjectorProjection));
ProcessorMetaSupplier processor = JoinByEquiJoinProcessorSupplier.supplier(new JetJoinInfo(joinType, new int[] { 0 }, new int[] { 0 }, nonEquiCondition, null), MAP_NAME, projectorSupplier);
TestSupport.verifyProcessor(adaptSupplier(processor)).jobConfig(new JobConfig().setArgument(SQL_ARGUMENTS_KEY_NAME, emptyList())).input(input).hazelcastInstance(instance()).outputChecker(SqlTestSupport::compareRowLists).disableProgressAssertion().expectOutput(output);
}
use of com.hazelcast.jet.sql.SqlTestSupport in project hazelcast by hazelcast.
the class JoinScanProcessorTest method runTest.
private void runTest(JoinRelType joinType, Expression<Boolean> rowProjectorCondition, List<Expression<?>> rowProjectorProjections, Expression<Boolean> condition, List<JetSqlRow> input, List<JetSqlRow> output) {
KvRowProjector.Supplier projectorSupplier = KvRowProjector.supplier(new QueryPath[] { QueryPath.KEY_PATH, QueryPath.VALUE_PATH }, new QueryDataType[] { INT, VARCHAR }, GenericQueryTargetDescriptor.DEFAULT, GenericQueryTargetDescriptor.DEFAULT, rowProjectorCondition, rowProjectorProjections);
JoinScanProcessorSupplier processor = new JoinScanProcessorSupplier(new JetJoinInfo(joinType, new int[] { 0 }, new int[] { 0 }, null, condition), MAP_NAME, projectorSupplier);
TestSupport.verifyProcessor(adaptSupplier(processor)).jobConfig(new JobConfig().setArgument(SQL_ARGUMENTS_KEY_NAME, emptyList())).input(input).hazelcastInstance(instance()).outputChecker(SqlTestSupport::compareRowLists).disableProgressAssertion().expectOutput(output);
}
use of com.hazelcast.jet.sql.SqlTestSupport in project hazelcast by hazelcast.
the class SqlHashJoinPTest method runTest.
private void runTest(JoinRelType joinType, Expression<Boolean> nonEquiCondition, int rightInputColumnCount, int[] leftEquiJoinIndices, int[] rightEquiJoinIndices, List<JetSqlRow> leftInput, List<JetSqlRow> rightInput, List<JetSqlRow> output) {
ProcessorSupplier processor = SqlHashJoinP.supplier(new JetJoinInfo(joinType, leftEquiJoinIndices, rightEquiJoinIndices, nonEquiCondition, null), rightInputColumnCount);
TestSupport.verifyProcessor(adaptSupplier(processor)).jobConfig(new JobConfig().setArgument(SQL_ARGUMENTS_KEY_NAME, emptyList())).inputs(asList(leftInput, rightInput), new int[] { LOW_PRIORITY, HIGH_PRIORITY }).hazelcastInstance(instance()).outputChecker(SqlTestSupport::compareRowLists).disableSnapshots().expectOutput(output);
}
Aggregations