2016-04-30 10 views
0

私はFlinkとScalaに苦労しています。Flink join、Scala APIの豊富な機能

私は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の例は見つかりませんでした。 mapまたはfilterで使用される豊富な関数については、examplesしか見つかりませんが、join変換(角かっこの間の関数)の構文が異なります。

答えて

1

val newBoard: DataSet[Cell] = board.rightOuterJoin(neighbours) 
          .where("coords").equalTo("cellCoords") 
           .apply(new YourJoinFunction()) 
           .withBroadcastSet(board, "aliveCells") 

class YourJoinFunction extends RichJoinFunction[IN1, IN2, Cell] { 
    override def join(first: IN1, second: IN2): Cell = { 
    // Do some rich function things, like 
    // override the open method so I can get 
    // the broadcasted set 
    } 
} 
を次のようにあなたはScalaのデータセットのAPIと RichJoinFunctionを使用することができます
関連する問題