Question
Databricks Error Inquiry: org.apache.spark.SparkException: Unable to fetch tables of db default
Hello. I am trying to run explorative Pyspark code within a Databricks ApacheSpark environs. I am pretty sure this syntax is correct, but the subject-referenced apache.spark error keeps throwing. Any insights, please?
databaseName = "database"
desiredColumn = "variable"
database = spark.sql(f"show tables in {databaseName} ").collect()
display(database)
tablenames = []
for row in database:
cols = spark.table(row.tableName).columns
listColumns= spark.table(row.tableName).columns
if desiredColumn in listColumns:
tablenames.append(row.tableName)

