2016-03-29 10 views
0

以下の拡張クラスRichGroupReduceFunctionはコンパイルされません。署名は一見、インターフェイスと一致しません。違いは分かりません。RichGroupReduceFunctionのメソッドシグネチャを修正しますか?

class SPointReduce extends RichGroupReduceFunction[Int, Int] { 
     override def reduce (
           values: Iterable[Int], 
           out: Collector[Int]): Unit = { 
     values.foreach { 
      value: Int => 
      out.collect(value) 
     } 
     } 
    } 

コンパイラレポート:

Error:(62, 16) method reduce overrides nothing. Note: the super classes of class SPointReduce contain the following, non final members named reduce: def reduce(x$1: Iterable[Nothing],x$2: org.apache.flink.util.Collector[Nothing]): Unit override def reduce (

答えて

0

あなたはRichGroupReduceFunctionreduceメソッドをオーバーライドするときにjava.lang.Iterableをインポートすることを確認する必要があります。それ以外の場合は、上記のエラーが発生します。

+0

これは意味があります。ありがとう。 –

関連する問題