A simple example:
JavaPairRDD<Long,String> rdd1= null;
JavaPairRDD<Double,Date> rdd2 = rdd1.flatMap(new PairFlatMapFunction<Tuple2<Long, String>, Double, Date>() {
/** Composes two instances of Function1 in a new Function1, with this function applied last.
*
* @tparam A the type to which function `g` can be applied
* @param g a function A => T1
* @return a new function `f` such that `f(x) == apply(g(x))`
*/
@Override
public <A> Function1<A, Iterable<Tuple2<Double, Date>>> compose(Function1<A, Tuple2<Long, String>> g) {
return null;
}
/** Composes two instances of Function1 in a new Function1, with this function applied first.
*
* @tparam A the result type of function `g`
* @param g a function R => A
* @return a new function `f` such that `f(x) == g(apply(x))`
*/
@Override
public <A> Function1<Tuple2<Long, String>, A> andThen(Function1<Iterable<Tuple2<Double, Date>>, A> g) {
return null;
}
@Override
public Iterable<Tuple2<Double, Date>> call(Tuple2<Long, String> longStringTuple2) throws Exception {
return null;
}
}) ;
This gives you compilation error;
Mohsen