How do we join fact orders with customer and date dimensions and project specific clean reporting columns?
A production star-schema enrichment joining fact tables with customer and date dimensions with explicit projection.
Data warehouse gold-layer dimensional modeling and executive BI reporting feeds.
from pyspark.sql.functions import col
fact_enriched = fact_orders \
.join(dim_customer, fact_orders.cust_key == dim_customer.cust_key, "inner") \
.join(dim_date, fact_orders.date_key == dim_date.date_key, "left") \
.select(
fact_orders.order_id,
dim_customer.customer_name,
dim_date.calendar_year,
fact_orders.gross_amount
)Practice typing production-grade PySpark code for Production Fact and Dimension Joining Pipeline.