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

    https://github.com/apache/spark/pull/16826#discussion_r103347559
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/internal/CatalogSuite.scala ---
    @@ -493,6 +493,28 @@ class CatalogSuite
         }
       }
     
    +  test("clone Catalog") {
    +    // need to test tempTables are cloned
    +    assert(spark.catalog.listTables().collect().isEmpty)
    +
    +    createTempTable("my_temp_table")
    +    assert(spark.catalog.listTables().collect().map(_.name).toSet == 
Set("my_temp_table"))
    +
    +    // inheritance
    +    val forkedSession = spark.cloneSession()
    +    assert(spark ne forkedSession)
    +    assert(spark.catalog ne forkedSession.catalog)
    +    assert(forkedSession.catalog.listTables().collect().map(_.name).toSet 
== Set("my_temp_table"))
    +
    +    // independence
    +    dropTable("my_temp_table") // drop table in original session
    +    assert(spark.catalog.listTables().collect().map(_.name).toSet == Set())
    +    assert(forkedSession.catalog.listTables().collect().map(_.name).toSet 
== Set("my_temp_table"))
    +    forkedSession.sessionState.catalog
    +      .createTempView("fork_table", Range(1, 2, 3, 4), overrideIfExists = 
true)
    +    assert(spark.catalog.listTables().collect().map(_.name).toSet == Set())
    +  }
    +
       // TODO: add tests for the rest of them
    --- End diff --
    
    After that TODO was added, there have been many additions of tests.
    This is a large interface, so the tests are scattered over this suite and 
`GlobalTempViewSuite`, `CachedTableSuite`, 
`PartitionProviderCompatibilitySuite`, `(Hive)MetadataCacheSuite`, `DDLSuite`, 
`ParquetQuerySuite` to name a few.
    Though I do see at least one test for every method in the trait `Catalog`.
    Checked with @cloud-fan in person, we should be fine with removing this 
TODO.


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