Search in sources :

Example 11 with PartitionedMapTable

use of com.hazelcast.sql.impl.schema.map.PartitionedMapTable in project hazelcast by hazelcast.

the class IMapSqlConnector method insertProcessor.

@Nonnull
@Override
public VertexWithInputConfig insertProcessor(@Nonnull DAG dag, @Nonnull Table table0) {
    PartitionedMapTable table = (PartitionedMapTable) table0;
    Vertex vertex = dag.newUniqueVertex(toString(table), new InsertProcessorSupplier(table.getMapName(), KvProjector.supplier(table.paths(), table.types(), (UpsertTargetDescriptor) table.getKeyJetMetadata(), (UpsertTargetDescriptor) table.getValueJetMetadata(), true))).localParallelism(1);
    return new VertexWithInputConfig(vertex, edge -> edge.distributed().allToOne(newUnsecureUuidString()));
}
Also used : Vertex(com.hazelcast.jet.core.Vertex) UpsertTargetDescriptor(com.hazelcast.jet.sql.impl.inject.UpsertTargetDescriptor) PartitionedMapTable(com.hazelcast.sql.impl.schema.map.PartitionedMapTable) Nonnull(javax.annotation.Nonnull)

Example 12 with PartitionedMapTable

use of com.hazelcast.sql.impl.schema.map.PartitionedMapTable in project hazelcast by hazelcast.

the class IMapSqlConnector method sinkProcessor.

@Nonnull
@Override
public Vertex sinkProcessor(@Nonnull DAG dag, @Nonnull Table table0) {
    PartitionedMapTable table = (PartitionedMapTable) table0;
    Vertex vStart = dag.newUniqueVertex("Project(" + toString(table) + ")", KvProcessors.entryProjector(table.paths(), table.types(), (UpsertTargetDescriptor) table.getKeyJetMetadata(), (UpsertTargetDescriptor) table.getValueJetMetadata(), true));
    Vertex vEnd = dag.newUniqueVertex(toString(table), writeMapP(table.getMapName()));
    dag.edge(between(vStart, vEnd));
    return vStart;
}
Also used : Vertex(com.hazelcast.jet.core.Vertex) UpsertTargetDescriptor(com.hazelcast.jet.sql.impl.inject.UpsertTargetDescriptor) PartitionedMapTable(com.hazelcast.sql.impl.schema.map.PartitionedMapTable) Nonnull(javax.annotation.Nonnull)

Aggregations

PartitionedMapTable (com.hazelcast.sql.impl.schema.map.PartitionedMapTable)12 Vertex (com.hazelcast.jet.core.Vertex)6 Nonnull (javax.annotation.Nonnull)6 List (java.util.List)5 UpsertTargetDescriptor (com.hazelcast.jet.sql.impl.inject.UpsertTargetDescriptor)4 HazelcastTable (com.hazelcast.jet.sql.impl.schema.HazelcastTable)3 ConstantTableStatistics (com.hazelcast.sql.impl.schema.ConstantTableStatistics)3 TableResolver (com.hazelcast.sql.impl.schema.TableResolver)3 RelNode (org.apache.calcite.rel.RelNode)3 TestTableResolver (com.hazelcast.jet.sql.impl.TestTableResolver)2 KvProjector (com.hazelcast.jet.sql.impl.connector.keyvalue.KvProjector)2 ExpressionValues (com.hazelcast.jet.sql.impl.opt.ExpressionValues)2 FullScanLogicalRel (com.hazelcast.jet.sql.impl.opt.logical.FullScanLogicalRel)2 QueryParameterMetadata (com.hazelcast.sql.impl.QueryParameterMetadata)2 ExpressionEvalContext (com.hazelcast.sql.impl.expression.ExpressionEvalContext)2 PlanObjectKey (com.hazelcast.sql.impl.optimizer.PlanObjectKey)2 PlanNodeSchema (com.hazelcast.sql.impl.plan.node.PlanNodeSchema)2 SqlCatalog (com.hazelcast.sql.impl.schema.SqlCatalog)2 TableField (com.hazelcast.sql.impl.schema.TableField)2 MapTableIndex (com.hazelcast.sql.impl.schema.map.MapTableIndex)2