分享

value / is not a member of String Error:(127, 53) value / is not a member of ...

value / is not a member of String
Error:(127, 53) value / is not a member of String
      val rdd8 = rdd7.map(x =>(x._1,x._2.reduce(_+_)/x._2.count(x=>true)))

中间的那个  / 它报错 ,是不是数据类型有错 ,我想做平均值
                                                    ^

已有(1)人评论

跳转到指定楼层
langke93 发表于 2017-8-6 14:24:17
map(x =>(x._1,x._2.reduce(_+_)/x._2.count(x=>true)))这个表达式是错的
/除号得出的结果是整型。整型.count是报错的。
count.jpg
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条