use of com.hazelcast.jet.sql.impl.connector.keyvalue.KvProjector in project hazelcast by hazelcast.
the class SinkMapPhysicalRel method entriesFn.
public Function<ExpressionEvalContext, Map<Object, Object>> entriesFn() {
PartitionedMapTable table = table();
List<ExpressionValues> values = this.values;
return evalContext -> {
KvProjector projector = KvProjector.supplier(table.paths(), table.types(), (UpsertTargetDescriptor) table.getKeyJetMetadata(), (UpsertTargetDescriptor) table.getValueJetMetadata(), true).get(evalContext.getSerializationService());
return values.stream().flatMap(vs -> vs.toValues(evalContext)).map(projector::project).collect(toMap(Entry::getKey, Entry::getValue));
};
}
use of com.hazelcast.jet.sql.impl.connector.keyvalue.KvProjector in project hazelcast by hazelcast.
the class InsertMapPhysicalRel method entriesFn.
public Function<ExpressionEvalContext, List<Entry<Object, Object>>> entriesFn() {
PartitionedMapTable table = table();
ExpressionValues values = this.values;
return evalContext -> {
KvProjector projector = KvProjector.supplier(table.paths(), table.types(), (UpsertTargetDescriptor) table.getKeyJetMetadata(), (UpsertTargetDescriptor) table.getValueJetMetadata(), true).get(evalContext.getSerializationService());
return values.toValues(evalContext).map(projector::project).collect(toList());
};
}
Aggregations