Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2024 09:00 AM
Hi @Krishna2110 ,
Here it is, it should work now
tables = spark.sql("SHOW TABLES IN ewt_edp_prod.crm_raw").collect()
for row in tables:
table_name = f"ewt_edp_prod.{row[0]}.{row[1]}"
try:
df = spark.table(table_name)
count = df.count()
print(f"Table {table_name} is accessible and has {count} rows.")
except Exception as e:
print(f"Error accessing table {table_name}: {e}")