org.apache.spark.rdd.RDD.collect(RDD.scala:904)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
org.apache.spark.deploy.yarn.ApplicationMaster$$anon$2.run(ApplicationMaster.scala:525)
Job aborted due to stage failure: Task 30 in stage 126.0 failed 4 times, most recent failure: Lost task 30.3 in stage 126.0 (TID 6544, rz-data-hdp-dn2882.rz.sankuai.com): java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer
很意外,RDD.collect()居然会报这个错。下面是对应的spark源码。求问大牛什么原因导致的?如何解决?  /**
   * Return an array that contains all of the elements in this RDD.
   */
  def collect(): Array[T] = withScope {
    val results = sc.runJob(this, (iter: Iterator[T]) => iter.toArray)
    Array.concat(results: _*)
  }