class_docstr: User-facing catalog API, accessible through `SparkSession.catalog`.
  
  This is a thin wrapper around its Scala implementation org.apache.spark.sql.catalog.Catalog.
  
  .. versionchanged:: 3.4.0
      Supports Spark Connect.
class_docstr_tok: ["User-facing","catalog","API",",","accessible","through","`","SparkSession.catalog","`",".","This","is","a","thin","wrapper","around","its","Scala","implementation","org.apache.spark.sql.catalog.Catalog",".","..","versionchanged",":",":","3.4.0","Supports","Spark","Connect","."]
docstr: Check if the table or view with the specified name exists.
  This can either be a temporary view or a table/view.
  
  .. versionadded:: 3.3.0
  
  Parameters
  ----------
  tableName : str
      name of the table to check existence.
      If no database is specified, first try to treat ``tableName`` as a
      multi-layer-namespace identifier, then try ``tableName`` as a normal table
      name in the current database if necessary.
  
      .. versionchanged:: 3.4.0
         Allow ``tableName`` to be qualified with catalog name when ``dbName`` is None.
  
  dbName : str, optional
      name of the database to check table existence in.
  
  Returns
  -------
  bool
      Indicating whether the table/view exists
  
  Examples
  --------
  This function can check if a table is defined or not:
  
  >>> spark.catalog.tableExists("unexisting_table")
  False
  >>> _ = spark.sql("DROP TABLE IF EXISTS tbl1")
  >>> _ = spark.sql("CREATE TABLE tbl1 (name STRING, age INT) USING parquet")
  >>> spark.catalog.tableExists("tbl1")
  True
  
  Using the fully qualified names for tables.
  
  >>> spark.catalog.tableExists("default.tbl1")
  True
  >>> spark.catalog.tableExists("spark_catalog.default.tbl1")
  True
  >>> spark.catalog.tableExists("tbl1", "default")
  True
  >>> _ = spark.sql("DROP TABLE tbl1")
  
  Check if views exist:
  
  >>> spark.catalog.tableExists("view1")
  False
  >>> _ = spark.sql("CREATE VIEW view1 AS SELECT 1")
  >>> spark.catalog.tableExists("view1")
  True
  
  Using the fully qualified names for views.
  
  >>> spark.catalog.tableExists("default.view1")
  True
  >>> spark.catalog.tableExists("spark_catalog.default.view1")
  True
  >>> spark.catalog.tableExists("view1", "default")
  True
  >>> _ = spark.sql("DROP VIEW view1")
  
  Check if temporary views exist:
  
  >>> _ = spark.sql("CREATE TEMPORARY VIEW view1 AS SELECT 1")
  >>> spark.catalog.tableExists("view1")
  True
  >>> df = spark.sql("DROP VIEW view1")
  >>> spark.catalog.tableExists("view1")
  False
docstr_tok: ["Check","if","the","table","or","view","with","the","specified","name","exists",".","This","can","either","be","a","temporary","view","or","a","table\/view",".","..","versionadded",":",":","3.3.0","Parameters","--","--","--","--","--","tableName",":","str","name","of","the","table","to","check","existence",".","If","no","database","is","specified",",","first","try","to","treat","``","tableName","``","as","a","multi-layer-namespace","identifier",",","then","try","``","tableName","``","as","a","normal","table","name","in","the","current","database","if","necessary",".","..","versionchanged",":",":","3.4.0","Allow","``","tableName","``","to","be","qualified","with","catalog","name","when","``","dbName","``","is","None",".","dbName",":","str",",","optional","name","of","the","database","to","check","table","existence","in",".","Returns","--","--","--","-","bool","Indicating","whether","the","table\/view","exists","Examples","--","--","--","--","This","function","can","check","if","a","table","is","defined","or","not",":",">",">",">","spark.catalog.tableExists","(","``","unexisting_table","''",")","False",">",">",">","_","=","spark.sql","(","``","DROP","TABLE","IF","EXISTS","tbl1","''",")",">",">",">","_","=","spark.sql","(","``","CREATE","TABLE","tbl1","(","name","STRING",",","age","INT",")","USING","parquet","''",")",">",">",">","spark.catalog.tableExists","(","``","tbl1","''",")","True","Using","the","fully","qualified","names","for","tables",".",">",">",">","spark.catalog.tableExists","(","``","default.tbl1","''",")","True",">",">",">","spark.catalog.tableExists","(","``","spark_catalog.default.tbl1","''",")","True",">",">",">","spark.catalog.tableExists","(","``","tbl1","''",",","``","default","''",")","True",">",">",">","_","=","spark.sql","(","``","DROP","TABLE","tbl1","''",")","Check","if","views","exist",":",">",">",">","spark.catalog.tableExists","(","``","view1","''",")","False",">",">",">","_","=","spark.sql","(","``","CREATE","VIEW","view1","AS","SELECT","1","''",")",">",">",">","spark.catalog.tableExists","(","``","view1","''",")","True","Using","the","fully","qualified","names","for","views",".",">",">",">","spark.catalog.tableExists","(","``","default.view1","''",")","True",">",">",">","spark.catalog.tableExists","(","``","spark_catalog.default.view1","''",")","True",">",">",">","spark.catalog.tableExists","(","``","view1","''",",","``","default","''",")","True",">",">",">","_","=","spark.sql","(","``","DROP","VIEW","view1","''",")","Check","if","temporary","views","exist",":",">",">",">","_","=","spark.sql","(","``","CREATE","TEMPORARY","VIEW","view1","AS","SELECT","1","''",")",">",">",">","spark.catalog.tableExists","(","``","view1","''",")","True",">",">",">","df","=","spark.sql","(","``","DROP","VIEW","view1","''",")",">",">",">","spark.catalog.tableExists","(","``","view1","''",")","False"]
code: def tableExists(
      self, tableName: str, dbName: Optional[str] = None
  ) -> bool:
      """Check if the table or view with the specified name exists.
      This can either be a temporary view or a table/view.
  
      .. versionadded:: 3.3.0
  
      Parameters
      ----------
      tableName : str
          name of the table to check existence.
          If no database is specified, first try to treat ``tableName`` as a
          multi-layer-namespace identifier, then try ``tableName`` as a normal table
          name in the current database if necessary.
  
          .. versionchanged:: 3.4.0
             Allow ``tableName`` to be qualified with catalog name when ``dbName`` is None.
  
      dbName : str, optional
          name of the database to check table existence in.
  
      Returns
      -------
      bool
          Indicating whether the table/view exists
  
      Examples
      --------
      This function can check if a table is defined or not:
  
      >>> spark.catalog.tableExists("unexisting_table")
      False
      >>> _ = spark.sql("DROP TABLE IF EXISTS tbl1")
      >>> _ = spark.sql("CREATE TABLE tbl1 (name STRING, age INT) USING parquet")
      >>> spark.catalog.tableExists("tbl1")
      True
  
      Using the fully qualified names for tables.
  
      >>> spark.catalog.tableExists("default.tbl1")
      True
      >>> spark.catalog.tableExists("spark_catalog.default.tbl1")
      True
      >>> spark.catalog.tableExists("tbl1", "default")
      True
      >>> _ = spark.sql("DROP TABLE tbl1")
  
      Check if views exist:
  
      >>> spark.catalog.tableExists("view1")
      False
      >>> _ = spark.sql("CREATE VIEW view1 AS SELECT 1")
      >>> spark.catalog.tableExists("view1")
      True
  
      Using the fully qualified names for views.
  
      >>> spark.catalog.tableExists("default.view1")
      True
      >>> spark.catalog.tableExists("spark_catalog.default.view1")
      True
      >>> spark.catalog.tableExists("view1", "default")
      True
      >>> _ = spark.sql("DROP VIEW view1")
  
      Check if temporary views exist:
  
      >>> _ = spark.sql("CREATE TEMPORARY VIEW view1 AS SELECT 1")
      >>> spark.catalog.tableExists("view1")
      True
      >>> df = spark.sql("DROP VIEW view1")
      >>> spark.catalog.tableExists("view1")
      False
      """
      if dbName is None:
          return self._jcatalog.tableExists(tableName)
      else:
          warnings.warn(
              "`dbName` has been deprecated since Spark 3.4 and might be removed in "
              "a future version. Use tableExists(`dbName.tableName`) instead.",
              FutureWarning,
          )
          return self._jcatalog.tableExists(dbName, tableName)
  
imports: import sys
  import warnings
  from typing import Any, Callable, NamedTuple, List, Optional, TYPE_CHECKING
  from pyspark.errors import PySparkTypeError
  from pyspark.storagelevel import StorageLevel
  from pyspark.sql.dataframe import DataFrame
  from pyspark.sql.session import SparkSession
  from pyspark.sql.types import StructType
label_desc: Use image node_id 16 for calling the Catalog obj's underlying member method code with example usage: obj.tableExists(tableName, dbName) and returns: self, self