我在和Flink和斯卡拉斗争。
我有一个连接变换 DataSet
这很管用,但我想把它变成一个 RichFuntion
,以便访问广播集:
val newBoard: DataSet[Cell] = board.rightOuterJoin(neighbours)
.where("coords").equalTo("cellCoords"){
(cell, neighbours) => {
// Do some rich function things, like
// override the open method so I can get
// the broadcasted set
}
}
}.withBroadcastSet(board, "aliveCells")
我看了所有的文件,但我找不到任何例子 RichJoinFuntion
在scala中使用。我只找到在中使用的丰富函数的例子 map
或者 filter
,但对于 join
转换(括号之间的函数与括号之间的函数)。
1条答案
按热度按时间rbl8hiat1#
你可以使用
RichJoinFunction
使用scala数据集api,如下所示