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

    https://github.com/apache/spark/pull/12121#discussion_r58418148
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
 ---
    @@ -547,4 +552,23 @@ class SessionCatalog(
         functionRegistry.lookupFunctionBuilder(name)
       }
     
    +
    +  // -----------------
    +  // | Other methods |
    +  // -----------------
    +
    +  /**
    +   * Drop all existing databases (except "default") along with all 
associated tables,
    +   * partitions and functions, and set the current database to "default".
    +   */
    +  def reset(): Unit = {
    +    val default = "default"
    +    listDatabases().filter(_ != default).foreach { db =>
    +      dropDatabase(db, ignoreIfNotExists = false, cascade = true)
    +    }
    +    tempTables.clear()
    +    functionRegistry.clear()
    --- End diff --
    
    right now this removes all functions (builtin or not). This is mainly used 
for tests only so I think it's OK.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to