Github user viirya commented on a diff in the pull request: https://github.com/apache/spark/pull/18717#discussion_r128942266 --- Diff: sql/core/src/test/scala/org/apache/spark/sql/DatasetCacheSuite.scala --- @@ -25,9 +25,22 @@ import org.apache.spark.storage.StorageLevel class DatasetCacheSuite extends QueryTest with SharedSQLContext { import testImplicits._ - // Clear all persistent datasets after each test override def afterEach(): Unit = { - spark.sharedState.cacheManager.clearCache() + try { + // Clear all persistent datasets after each test + spark.sharedState.cacheManager.clearCache() + } finally { + super.afterEach() + } + } + + test("eager persist") { + val ds = Seq("1", "2").toDF() + ds.persist(eager = false) + assert(!ds.isMaterialized()) + ds.persist(eager = true) + ds.collect() --- End diff -- To test if it is eagerly persisted, why we need a collect here?
--- 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