use of com.hazelcast.jet.sql.impl.connector.SqlConnector.VertexWithInputConfig in project hazelcast by hazelcast.
the class CreateDagVisitor method onNestedLoopJoin.
public Vertex onNestedLoopJoin(JoinNestedLoopPhysicalRel rel) {
assert rel.getRight() instanceof FullScanPhysicalRel : rel.getRight().getClass();
Table rightTable = rel.getRight().getTable().unwrap(HazelcastTable.class).getTarget();
collectObjectKeys(rightTable);
VertexWithInputConfig vertexWithConfig = getJetSqlConnector(rightTable).nestedLoopReader(dag, rightTable, rel.rightFilter(parameterMetadata), rel.rightProjection(parameterMetadata), rel.joinInfo(parameterMetadata));
Vertex vertex = vertexWithConfig.vertex();
connectInput(rel.getLeft(), vertex, vertexWithConfig.configureEdgeFn());
return vertex;
}
use of com.hazelcast.jet.sql.impl.connector.SqlConnector.VertexWithInputConfig in project hazelcast by hazelcast.
the class CreateDagVisitor method onInsert.
public Vertex onInsert(InsertPhysicalRel rel) {
Table table = rel.getTable().unwrap(HazelcastTable.class).getTarget();
collectObjectKeys(table);
VertexWithInputConfig vertexWithConfig = getJetSqlConnector(table).insertProcessor(dag, table);
Vertex vertex = vertexWithConfig.vertex();
connectInput(rel.getInput(), vertex, vertexWithConfig.configureEdgeFn());
return vertex;
}
use of com.hazelcast.jet.sql.impl.connector.SqlConnector.VertexWithInputConfig in project hazelcast by hazelcast.
the class JoinerTest method test_joinByPredicate.
@Test
@Parameters(method = "joinTypes")
public void test_joinByPredicate(JoinRelType joinType) {
// given
given(rightRowProjectorSupplier.paths()).willReturn(new QueryPath[] { QueryPath.create("path") });
given(dag.newUniqueVertex(contains("Predicate"), isA(ProcessorMetaSupplier.class))).willReturn(vertex);
// when
VertexWithInputConfig vertexWithConfig = Joiner.join(dag, "imap-name", "table-name", joinInfo(joinType, new int[] { 0 }, new int[] { 0 }), rightRowProjectorSupplier);
// then
assertThat(vertexWithConfig.vertex()).isEqualTo(vertex);
assertThat(vertexWithConfig.configureEdgeFn()).isNotNull();
}
use of com.hazelcast.jet.sql.impl.connector.SqlConnector.VertexWithInputConfig in project hazelcast by hazelcast.
the class JoinerTest method test_joinByPrimitiveKey.
@Test
@Parameters(method = "joinTypes")
public void test_joinByPrimitiveKey(JoinRelType joinType) {
// given
given(rightRowProjectorSupplier.paths()).willReturn(new QueryPath[] { KEY_PATH });
given(dag.newUniqueVertex(contains("Lookup"), isA(JoinByPrimitiveKeyProcessorSupplier.class))).willReturn(vertex);
// when
VertexWithInputConfig vertexWithConfig = Joiner.join(dag, "imap-name", "table-name", joinInfo(joinType, new int[] { 0 }, new int[] { 0 }), rightRowProjectorSupplier);
// then
assertThat(vertexWithConfig.vertex()).isEqualTo(vertex);
assertThat(vertexWithConfig.configureEdgeFn()).isNotNull();
}
use of com.hazelcast.jet.sql.impl.connector.SqlConnector.VertexWithInputConfig in project hazelcast by hazelcast.
the class JoinerTest method test_joinByScan.
@Test
@Parameters(method = "joinTypes")
public void test_joinByScan(JoinRelType joinType) {
// given
given(rightRowProjectorSupplier.paths()).willReturn(new QueryPath[] { VALUE_PATH });
given(dag.newUniqueVertex(contains("Scan"), isA(JoinScanProcessorSupplier.class))).willReturn(vertex);
// when
VertexWithInputConfig vertexWithConfig = Joiner.join(dag, "imap-name", "table-name", joinInfo(joinType, new int[0], new int[0]), rightRowProjectorSupplier);
// then
assertThat(vertexWithConfig.vertex()).isEqualTo(vertex);
assertThat(vertexWithConfig.configureEdgeFn()).isNull();
}
Aggregations