ClassCastException: cannot assign instance of scala.collection.immutable.List$SerializationProxy in instance of org.apache.spark.rdd.MapPartitionsRDD
问题 I have a spring boot microservice talking to a remote spark cluster with 3 nodes, and executing the following logic: Dataset<Row> df = sparkSession.read().json("/opt/enso/test.json"); StructType schema = df.schema(); JavaPairRDD<Row, Long> zippedRows = df.toJavaRDD().zipWithIndex(); JavaPairRDD<Row, Long> filteredRows = zippedRows.filter(new Function<Tuple2<Row,Long>,Boolean> () { @Override public Boolean call(Tuple2<Row,Long> v1) throws Exception { return v1._2 >= 1 && v1._2 <= 5; } });