GitHub user breakdawn opened a pull request: https://github.com/apache/spark/pull/14324
[SPARK-16664][SQL] Fix persist call on Data frames with more than 200⦠## What changes were proposed in this pull request? f12f11e578169b47e3f8b18b299948c0670ba585 introduced this bug, missed foreach as map ## How was this patch tested? manual tests done with following: test("test data frame with 201 columns") { val sparkConfig = new SparkConf() val parallelism = 5 sparkConfig.set("spark.default.parallelism", s"$parallelism") sparkConfig.set("spark.sql.shuffle.partitions", s"$parallelism") val sc = new SparkContext(s"local[3]", "TestNestedJson", sparkConfig) val sqlContext = new SQLContext(sc) // create dataframe with 201 columns and fake 201 values val size = 201 val rdd: RDD[Seq[Long]] = sc.parallelize(Seq(Seq.range(0, size))) val rowRdd: RDD[Row] = rdd.map(d => Row.fromSeq(d)) val schemas = List.range(0, size).map(a => StructField("name"+ a, LongType, true)) val testSchema = StructType(schemas) val testDf = sqlContext.createDataFrame(rowRdd, testSchema) // test value assert(testDf.persist.take(1).apply(0).toSeq(100).asInstanceOf[Long] == 100) sc.stop() } You can merge this pull request into a Git repository by running: $ git pull https://github.com/breakdawn/spark master Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/14324.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #14324 ---- commit 7040dc9f45eae56cb706cb44cd48bea16217db1e Author: Wesley Tang <tangming...@mininglamp.com> Date: 2016-07-23T04:35:48Z [SPARK-16664][SQL] Fix persist call on Data frames with more than 200 columns is wiping out the data. ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org