[
https://issues.apache.org/jira/browse/SPARK-34076?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Wenchen Fan resolved SPARK-34076.
---------------------------------
Fix Version/s: 3.1.1
Resolution: Fixed
Issue resolved by pull request 31136
[https://github.com/apache/spark/pull/31136]
> SQLContext.dropTempTable fails if cache is non-empty
> ----------------------------------------------------
>
> Key: SPARK-34076
> URL: https://issues.apache.org/jira/browse/SPARK-34076
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 3.1.0
> Reporter: Chao Sun
> Assignee: Chao Sun
> Priority: Major
> Fix For: 3.1.1
>
>
> {{SQLContext.dropTempView}} calls {{CatalogImpl.dropTempView}} which is
> implemented as following:
> {code}
> override def dropTempView(viewName: String): Boolean = {
> sparkSession.sessionState.catalog.getTempView(viewName).exists { viewDef
> =>
> sparkSession.sharedState.cacheManager.uncacheQuery(
> sparkSession, viewDef, cascade = false)
> sessionCatalog.dropTempView(viewName)
> }
> }
> {code}
> Here, the logical plan {{viewDef}} is not resolved, and when passing to
> {{uncacheQuery}}, it could fail at {{sameResult}} call, when canonicalized
> plan is compared. The error message looks like:
> {code}
> Invalid call to qualifier on unresolved object, tree: 'key
> {code}
> This can be reproduced via:
> {code}
> test("XXX") {
> val t = "t"
> val v = "v"
> withTable(t) {
> withTempView(v) {
> sql(s"CREATE TABLE $t AS SELECT * FROM src")
> sql(s"CACHE TABLE $t")
> sql(s"CREATE TEMPORARY VIEW $v AS SELECT key FROM src LIMIT 10")
> }
> }
> }
> {code}
> through test.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]