This repository contains a simple and production-like example of how to use PySpark's spark.sql() function by passing DataFrames directly as named parameters β avoiding the need for temporary views.
Check out the full Medium article here:
π Efficient Spark SQL without Temp Views: Cleaner Data Pipelines
β Works with PySpark 3.3 and later
- How to write SQL queries on DataFrames without creating temp views
- How to build a simple data transformation pipeline (Bronze β Silver layer)
- Why this approach improves clarity and maintainability in Spark projects
We simulate a medallion architecture scenario with:
- Bronze Layer: Raw data for customers and orders
- Silver Layer:
- Join customers and orders
- Filter high-value orders
- Aggregate spending per customer