逆光之处是快乐 发表于 2017-11-29 11:42:41

Spark scala

这个括号该怎们去掉(20170701001630,iptv7710965932)   ,我想他在hdfs 上是两个字段


逆光之处是快乐 发表于 2017-11-29 11:45:17

00|iptv2014050901|20171123120126|08
00|iptv2014070803|20171123120127|08
00|iptv2014030803|20171123120132|01
00|iptv2014050901|20171123120156|08
00|iptv2014070803|20171123120157|08
00|iptv2014030803|20171123120202|01
00|iptv2014050901|20171123120226|08
00|iptv2014070803|20171123120227|08
00|iptv2014030803|20171123120232|01
00|iptv2014050901|20171123120256|08
00|iptv2014070803|20171123120257|08
00|iptv2014030803|20171123120302|01
00|iptv2014050901|20171123120326|08
00|iptv2014070803|20171123120327|08
00|iptv2014030803|20171123120332|01

desehawk 发表于 2017-11-29 15:09:41

将(datatime,iptv)
改成这样的
map(line=>
   | {val filed=line.split("\\|")
   | val datatime=filed(2)
   | val iptv=filed(1)
   | datatime+","+iptv})


最后输出结果如下:

页: [1]
查看完整版本: Spark scala