Github user liancheng commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2501#discussion_r18090525
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/CachedTableSuite.scala ---
    @@ -20,14 +20,32 @@ package org.apache.spark.sql
     import org.apache.spark.sql.TestData._
     import org.apache.spark.sql.columnar.{InMemoryRelation, 
InMemoryColumnarTableScan}
     import org.apache.spark.sql.test.TestSQLContext
    -import org.apache.spark.sql.test.TestSQLContext._
     
     case class BigData(s: String)
     
     class CachedTableSuite extends QueryTest {
    +  import TestSQLContext._
       TestData // Load test tables.
     
    -  test("too big for memory") {
    +  /**
    +   * Throws a test failed exception when the number of cached tables 
differs from the expected
    +   * number.
    +   */
    +  def assertCached(query: SchemaRDD, numCachedTables: Int = 1): Unit = {
    +    val planWithCaching = query.queryExecution.withCachedData
    +    val cachedData = planWithCaching collect {
    +      case cached: InMemoryRelation => cached
    +    }
    +
    +    if (cachedData.size != numCachedTables) {
    +      fail(
    +        s"Expected query to contain $numCachedTables, but it actually had 
${cachedData.size}\n" +
    +        planWithCaching)
    +    }
    +  }
    +
    +  // TODO: Reenable.
    +  ignore("too big for memory") {
    --- End diff --
    
    Verified locally, there's nothing wrong with this test case, should 
reenable. I guess you disabled this to accelerate local testing?


---
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

Reply via email to