Search in sources :

Example 1 with SqlTestSupport

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);
}
Also used : KvRowProjector(com.hazelcast.jet.sql.impl.connector.keyvalue.KvRowProjector) SqlTestSupport(com.hazelcast.jet.sql.SqlTestSupport) ProcessorSupplier(com.hazelcast.jet.core.ProcessorSupplier) JobConfig(com.hazelcast.jet.config.JobConfig)

Example 2 with SqlTestSupport

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);
}
Also used : JetJoinInfo(com.hazelcast.jet.sql.impl.JetJoinInfo) KvRowProjector(com.hazelcast.jet.sql.impl.connector.keyvalue.KvRowProjector) SqlTestSupport(com.hazelcast.jet.sql.SqlTestSupport) ProcessorMetaSupplier(com.hazelcast.jet.core.ProcessorMetaSupplier) JobConfig(com.hazelcast.jet.config.JobConfig)

Example 3 with SqlTestSupport

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);
}
Also used : JetJoinInfo(com.hazelcast.jet.sql.impl.JetJoinInfo) KvRowProjector(com.hazelcast.jet.sql.impl.connector.keyvalue.KvRowProjector) SqlTestSupport(com.hazelcast.jet.sql.SqlTestSupport) JobConfig(com.hazelcast.jet.config.JobConfig)

Example 4 with SqlTestSupport

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);
}
Also used : JetJoinInfo(com.hazelcast.jet.sql.impl.JetJoinInfo) SqlTestSupport(com.hazelcast.jet.sql.SqlTestSupport) ProcessorSupplier(com.hazelcast.jet.core.ProcessorSupplier) JobConfig(com.hazelcast.jet.config.JobConfig)

Aggregations

JobConfig (com.hazelcast.jet.config.JobConfig)4 SqlTestSupport (com.hazelcast.jet.sql.SqlTestSupport)4 JetJoinInfo (com.hazelcast.jet.sql.impl.JetJoinInfo)3 KvRowProjector (com.hazelcast.jet.sql.impl.connector.keyvalue.KvRowProjector)3 ProcessorSupplier (com.hazelcast.jet.core.ProcessorSupplier)2 ProcessorMetaSupplier (com.hazelcast.jet.core.ProcessorMetaSupplier)1