Exploring Warehouse Schemas
Tutorial
Exploring Warehouse Schemas
Discover tables, columns, and relationships in your data warehouse
What You'll Learn
- Catalog Browsing - List catalogs, schemas, and tables
- Column Discovery - Inspect table columns and data types
- Search - Find tables and columns by pattern
- Schema Navigation - Drill down through the catalog hierarchy
1
Setup
Connect to the platform
# Cell 1 — ParametersUSERNAME = "_FILL_ME_IN_" # Set your email before running# Cell 2 — Connectfrom graph_olap import GraphOLAPClientclient = GraphOLAPClient(username=USERNAME)
# Cell 3 — Provisionfrom notebook_setup import provisionpersonas, conn = provision(USERNAME)analyst = personas["analyst"]admin = personas["admin"]ops = personas["ops"]client = analyst
print(f"Connected to: {client._config.api_url}")
2
Browsing the Catalog
Navigate catalogs, schemas, and tables
# List available catalogscatalogs = client.schema.list_catalogs()print("Catalogs:")if not catalogs: print(" (no catalogs in cache — Starburst cache may be cold)")else: for cat in catalogs: print(f" {cat.catalog_name}")
# List schemas within a catalog cat_name = catalogs[0].catalog_name schemas = client.schema.list_schemas(cat_name) print(f"\nSchemas in '{cat_name}':") for s in schemas: print(f" {s.schema_name}")
# List tables within a schema if schemas: schema_name = schemas[0].schema_name tables = client.schema.list_tables(cat_name, schema_name) print(f"\nTables in '{cat_name}.{schema_name}':") for t in tables: print(f" {t.table_name}")
3
Inspecting Columns
View column names and data types
# List columns for the customer demographics tableif catalogs and schemas and tables: columns = client.schema.list_columns(cat_name, schema_name, tables[0].table_name) print(f"Columns in '{tables[0].table_name}':") for col in columns: print(f" {col.column_name}: {col.data_type}")
# List columns for the account data table if len(tables) > 1: acct_columns = client.schema.list_columns(cat_name, schema_name, tables[1].table_name) print(f"\nColumns in '{tables[1].table_name}':") for col in acct_columns: print(f" {col.column_name}: {col.data_type}")else: print("Skipped — no catalogs, schemas, or tables available.")
4
Searching Tables and Columns
Find tables and columns by pattern
# Search for tables matching a patterntable_results = client.schema.search_tables("bis", limit=10)print("Tables matching 'bis':")for t in table_results: print(f" {t}")
# Search for columns matching a patterncolumn_results = client.schema.search_columns("psdo", limit=10)print("\nColumns matching 'psdo':")for c in column_results: print(f" {c}")Key Takeaways
- Use
client.schema(singular) to access the schema browser - Navigate the hierarchy:
list_catalogs()→list_schemas()→list_tables()→list_columns() - Use
search_tables()andsearch_columns()to find objects by pattern - Column metadata helps you understand your data before building mappings