【发布时间】:2021-09-29 18:37:47
【问题描述】:
Flink 文档中已经提到 DataSet API will be deprecated 将来。因此,我正在考虑在 Batch Mode(我相信它现在处于 Beta 版)迁移中将此 Dataset API 原型设计为 DataStream API。
我们的代码库中有这个(类似的)代码,它在数据集上使用 leftOuterJoin。
DataSet<SomeOutType> joined_out = datasetA.
leftOuterJoin(datasetB, JoinOperatorBase.JoinHint.BROADCAST_HASH_SECOND)
.where((left) -> coalesce(left.getId(), -9999999L))
.equalTo((right) -> right.company_id).with((JoinFunction<SomeTypeA, SomeTypeB, SomeOutType>) (left, right) -> {
SomeOutType recNew = SomeOutType.newBuilder().build();
recNew.setCustomerId(left.getCustomerId());
recNew.setCustomerName((right != null && right.cust_name != null) ? right.cust_name : "Blank");
....
....
....
return recNew;
});
问题是我无法在 Datastream API 文档 - Join 中找到 Left Join 或 Left Outer Join 等效项。
由于他们正在考虑完全弃用 DataSet API,我假设现在应该有一种方法可以在 DataStream API 中执行此 Left Outer Join。
有人可以指导我以正确的方式做到这一点吗? TIA
【问题讨论】:
标签: apache-flink flink-streaming flink-batch