【发布时间】:2023-03-31 20:35:01
【问题描述】:
我正在处理Data Algorithms 的书和
尝试访问 Java 中的 Tuple2 成员时出现以下编译错误:
我承认,我对 Scala 很陌生,但语法看起来是正确的,每个 scala-lang,所以任何帮助表示赞赏。谢谢
_1 has private access in scala.Tuple2
_2 has private access in scala.Tuple2
有问题的代码sn-p
List<Tuple2<String, Iterable<Tuple2<Integer,Integer>>>> output2 = groups.collect();
for(Tuple2<String, Iterable<Tuple2<Integer,Integer>>> t : output2){
Iterable<Tuple2<Integer,Integer>> list = t._2;
System.out.println(t._1);
for(Tuple2<Integer,Integer> t2 : list){
System.out.println(t2._1 + "," + t2._2);
}
}
【问题讨论】:
标签: java scala apache-spark tuples