[ https://issues.apache.org/jira/browse/SPARK-34076?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17262981#comment-17262981 ]
Apache Spark commented on SPARK-34076: -------------------------------------- User 'sunchao' has created a pull request for this issue: 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 > Priority: Major > > {{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: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org