pyspark.sql.SQLContext.tables#
- SQLContext.tables(dbName=None)[source]#
Returns a
DataFramecontaining names of tables in the given database.If
dbNameis not specified, the current database will be used.The returned DataFrame has two columns:
tableNameandisTemporary(a column withBooleanTypeindicating if a table is a temporary one or not).Added in version 1.3.0.
- Parameters:
- dbName: str, optional
name of the database to use.
- Returns:
Examples
>>> sqlContext.registerDataFrameAsTable(df, "table1") >>> df2 = sqlContext.tables() >>> df2.filter("tableName = 'table1'").first() Row(namespace='', tableName='table1', isTemporary=True)