MaxGekk commented on a change in pull request #31524:
URL: https://github.com/apache/spark/pull/31524#discussion_r579646797



##########
File path: docs/sql-ref-syntax-ddl-drop-table.md
##########
@@ -26,6 +26,8 @@ if the table is not `EXTERNAL` table. If the table is not 
present it throws an e
 
 In case of an external table, only the associated metadata information is 
removed from the metastore database.
 
+If the table is cached, the command uncaches the table and all its dependents.

Review comment:
       ```scala
   scala> 
Seq(0).toDF("c0").write.mode("overwrite").parquet("/Users/maximgekk/tmp/tbl")
   
   scala> sql("CREATE TABLE tbl2 (c0 INT) USING parquet LOCATION 
'/Users/maximgekk/tmp/tbl'")
   res11: org.apache.spark.sql.DataFrame = []
   
   scala> val tbl2 = spark.table("tbl2")
   tbl2: org.apache.spark.sql.DataFrame = [c0: int]
   
   scala> tbl2.cache()
   res12: tbl2.type = [c0: int]
   
   scala> tbl2.show(false)
   +---+
   |c0 |
   +---+
   |0  |
   +---+
   
   
   scala> tbl2.select(($"c0" + 2).as("c1")).createOrReplaceTempView("tmp_view2")
   
   scala> val v2 = spark.table("tmp_view2")
   v2: org.apache.spark.sql.DataFrame = [c1: int]
   
   scala> v2.cache()
   res15: v2.type = [c1: int]
   
   scala> v2.show(false)
   +---+
   |c1 |
   +---+
   |2  |
   +---+
   
   
   scala> sql("DROP TABLE tbl2")
   res17: org.apache.spark.sql.DataFrame = []
   
   scala> v2.show(false)
   +---+
   |c1 |
   +---+
   |2  |
   +---+
   ```




----------------------------------------------------------------
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to