左加入榛子喷气机

问题描述

我在我的应用程序中使用 Hazelcast Jet。

        // value1
        BatchStageWithKey<Map<String,Object>,Object> indianCustomerjson = value
                .filter(model -> model.nationName().equals("india"))
                .map(model -> JsonUtil.mapFrom(model.getJson_value()))
                .groupingKey(p_json -> p_json.get("id"));

        // value2
        BatchStageWithKey<Map<String,Object> usaCustomerjson = value
                .filter(model -> model.nationName().equals("usa"))
                .map(model -> JsonUtil.mapFrom(model.getJson_value()))
                .groupingKey(j_json -> j_json.get("id"));

这里我有两个 BatchStageWithKey 结果。

现在我想做左连接

from indianCustomerjson left join usaCustomerjson 

基于 BatchStageKey

解决方法

连接是在 Hazelcast Jet 中手动完成的。您可以进行散列连接或共同组,请参阅以下示例:https://github.com/hazelcast/hazelcast-jet/tree/master/examples#joins