You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by btiernay <bt...@hotmail.com> on 2015/03/02 23:03:08 UTC
JavaRDD method ambiguous after upgrading to Java 8
The following method demonstrates the issue:
private static Tuple2<String, String> group(JavaPairRDD<String, String>
rdd, Function<Tuple2<String, String>, String> f) {
return rdd.groupBy(f);
}
I get the following compilation error using Spark 1.1.1 and Java 8u31:
The method groupBy(Function<Tuple2<String,String>,String>) is ambiguous
for the type JavaPairRDD<String,String>
I believe it is ambiguous because both JavaPairRDD and JavaRDDLike offer the
same method.
Has anyone encountered this before? Is there a solution?
Thanks!
--
View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/JavaRDD-method-ambiguous-after-upgrading-to-Java-8-tp21882.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
For additional commands, e-mail: user-help@spark.apache.org
Re: JavaRDD method ambiguous after upgrading to Java 8
Posted by btiernay <bt...@hotmail.com>.
Seem like upgrading to 1.2.0 fixed the error.
--
View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/JavaRDD-method-ambiguous-after-upgrading-to-Java-8-tp21882p21883.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
For additional commands, e-mail: user-help@spark.apache.org
Re: JavaRDD method ambiguous after upgrading to Java 8
Posted by Sean Owen <so...@cloudera.com>.
What's your actual code? that can't compile since groupBy would return
a JavaPairRDD.
I tried compiling that (after changing to void type) with Java 7 and
Java 8 (meaning, not just the JDK but compiling for the language level
too) and both worked.
On Mon, Mar 2, 2015 at 10:03 PM, btiernay <bt...@hotmail.com> wrote:
> The following method demonstrates the issue:
>
> private static Tuple2<String, String> group(JavaPairRDD<String, String>
> rdd, Function<Tuple2<String, String>, String> f) {
> return rdd.groupBy(f);
> }
>
> I get the following compilation error using Spark 1.1.1 and Java 8u31:
>
> The method groupBy(Function<Tuple2<String,String>,String>) is ambiguous
> for the type JavaPairRDD<String,String>
>
> I believe it is ambiguous because both JavaPairRDD and JavaRDDLike offer the
> same method.
>
> Has anyone encountered this before? Is there a solution?
>
> Thanks!
>
>
>
> --
> View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/JavaRDD-method-ambiguous-after-upgrading-to-Java-8-tp21882.html
> Sent from the Apache Spark User List mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
> For additional commands, e-mail: user-help@spark.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
For additional commands, e-mail: user-help@spark.apache.org