【发布时间】:2017-04-19 22:12:02
【问题描述】:
我正在使用 Cassandra 2.2.8、JDK8、spark-cassandra-connector-java_2.10、spark-cassandra-connector_2.11-2.0.0-M3、cassandra-driver-core-3.1.0 及以下版本 Cassandra Spark Connector Example JavaDemo。必须修复此演示以使用新的 2.1 Connetcor API 进行编译。我已经修复了几件事,但下面的这件事让我很难过: 此行编译错误:
JavaPairRDD<Integer, BigDecimal> allSalesRDD = joinedRDD.flatMap(new PairFlatMapFunction<Tuple2<Integer, Tuple2<Sale, Product>>, Integer, BigDecimal>() {
@Override
public Iterable<Tuple2<Integer, BigDecimal>> call(Tuple2<Integer, Tuple2<Sale, Product>> input) throws Exception {
错误:
The method
flatMap(FlatMapFunction<Tuple2<Integer,Tuple2<SparkJavaDemo.Sale,SparkJavaDemo.Product>>,U>) in the type
AbstractJavaRDDLike<Tuple2<Integer,Tuple2<SparkJavaDemo.Sale,SparkJavaDemo.Product>>,JavaPairRDD<Integer,Tuple2<SparkJavaDemo.
Sale,SparkJavaDemo.Product>>> is not applicable for the arguments (new
PairFlatMapFunction<Tuple2<Integer,Tuple2<SparkJavaDemo.Sale,SparkJavaDemo.Product>>,Integer,BigDecimal>(){})
谢谢
【问题讨论】:
标签: java apache-spark cassandra-2.0 spark-cassandra-connector