Github user adrian-wang commented on a diff in the pull request:
https://github.com/apache/spark/pull/6636#discussion_r31702662
--- Diff: sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala ---
@@ -679,7 +679,25 @@ class SQLContext(@transient val sparkContext:
SparkContext)
* @since 1.3.0
*/
def dropTempTable(tableName: String): Unit = {
- cacheManager.tryUncacheQuery(table(tableName))
+ dropTempTable(tableName, ifExists = false)
+ }
+
+ /**
+ * Drops the temporary table with the given table name in the catalog.
If the table has been
+ * cached/persisted before, it's also unpersisted.
+ *
+ * @param tableName the name of the table to be unregistered.
+ * @param ifExists whether ignore non-existent table
+ *
+ * @group basic
+ * @since 1.5.0
+ */
+ def dropTempTable(tableName: String, ifExists: Boolean): Unit = {
--- End diff --
If using Try, we have to look into the return to check the reason. Not only
non-existent table leads to failure of drop operation. This would only ignore
the certain case.
I'll close it if not necessary.
---
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]