szymon_dybczak
Esteemed Contributor III

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}")