apache spark JAVA将Tuple2的数据集转换为字符串
我有这个数据集
DataSet<Tuple2<String, Integer>> counts =
// split up the lines in pairs (2-tuples) containing: (word,1)
text.flatMap(new LineSplitter())
// group by the tuple field "0" and sum up tuple field "1"
.groupBy(0)
.sum(1);
counts.print();
返回
(some,3)
(text,1)
(here,1)
我想在API响应中以字符串的形式返回它,但我尝试的一切都不起作用
共 (0) 个答案