HyukjinKwon commented on a change in pull request #33461:
URL: https://github.com/apache/spark/pull/33461#discussion_r673908232



##########
File path: python/pyspark/sql/catalog.py
##########
@@ -185,6 +185,14 @@ def tableExists(self, tableName, dbName=None):
         >>> df = spark.sql("CREATE TABLE tab1 (name STRING, age INT) USING 
parquet")
         >>> spark.catalog.tableExists("tab1")
         True
+        >>> spark.catalog.tableExists("view1")

Review comment:
       Since we're improving the doc tests here, shall we make it more 
readable? e.g.)
   
   ```
   Examples
   ----------
   
   The example below checks if 'unexisting_table' table.
   
   >>> spark.sql("CREATE TABLE tab1 (name STRING, age INT) USING parquet")
   >>> spark.catalog.tableExists("tab1")
   True
   >>> spark.sql("DROP TABLE tab1")
   >>> spark.catalog.tableExists("unexisting_table")
   False
   
   This function can check if a view is defined or not:
   
   >>> df = spark.sql("CREATE VIEW view1 AS SELECT * FROM tab1")
   >>> spark.catalog.tableExists("view1")
   True
   >>> df = spark.sql("DROP VIEW view1")
   >>> spark.catalog.tableExists("view1")
   False
   ```




-- 
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.

To unsubscribe, e-mail: [email protected]

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