Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2022 04:53 AM
databaseName = "db"
desiredColumn = "project_id"
database = spark.sql(f"show tables in {databaseName} ").collect()
tablenames = []
for row in database:
cols = spark.table(row.tableName).columns
if desiredColumn in cols:
tablenames.append(row.tableName)
Something close to that should work.