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

    https://github.com/apache/spark/pull/21018#discussion_r183907321
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/CachedTableSuite.scala ---
    @@ -794,4 +795,28 @@ class CachedTableSuite extends QueryTest with 
SQLTestUtils with SharedSQLContext
           }
         }
       }
    +
    +  private def checkIfNoJobTriggered(f: => DataFrame): DataFrame = {
    +    var numJobTrigered = 0
    +    val jobListener = new SparkListener {
    +      override def onJobStart(jobStart: SparkListenerJobStart): Unit = {
    +        numJobTrigered += 1
    +      }
    +    }
    +    sparkContext.addSparkListener(jobListener)
    +    try {
    +      val df = f
    +      assert(numJobTrigered === 0)
    +      df
    +    } finally {
    +      sparkContext.removeSparkListener(jobListener)
    +    }
    +  }
    +
    +  test("SPARK-23880 table cache should be lazy and don't trigger any 
jobs") {
    --- End diff --
    
    oh, I'll recheck. Thanks!


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to