cloud-fan commented on a change in pull request #30743:
URL: https://github.com/apache/spark/pull/30743#discussion_r543122777



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/CacheTableExec.scala
##########
@@ -87,3 +87,16 @@ case class CacheTableAsSelectExec(
     sparkSession.table(tempViewName)
   }
 }
+
+case class UncacheTableExec(
+    relation: LogicalPlan,
+    cascade: Boolean) extends V2CommandExec {
+  override def run(): Seq[InternalRow] = {
+    val sparkSession = sqlContext.sparkSession
+    val df = Dataset.ofRows(sparkSession, relation)
+    sparkSession.sharedState.cacheManager.uncacheQuery(df, cascade)

Review comment:
       `uncacheQuery` can take `LogicalPlan` directly. Let's use that overload 
to avoid creating a dataframe.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to