赞
踩
User class threw exception: org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 14.0 failed 4 times, most recent failure: Lost task 0.3 in stage 14.0 (TID 390, 9.54.136.125, executor 9): java.lang.NumberFormatException: For input string: "5326795854138346"
使用Scala语言报错,从网上找的资料可以知道,Int类型最长到10位数,而我输入的"5326795854138346",远多于十位数,这时将他转成Int类型就报错,
可以这么改:
val data1 = data.map(_.toString.toLong)
一般要先转换成string类型 再转换
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。