Land it in bronze
The file goes into the lakehouse as it arrived, as a Delta table, with when it was loaded and where it came from.
Bronze is the data as it arrived. Nothing is cleaned or dropped here, so when a number looks wrong later, you can always go back to what the source really sent.
The lakehouse
In a workspace on a Fabric capacity (a trial works), select New item, then Lakehouse, and name it sales. A lakehouse has two parts: Files, for files of any kind, and Tables, for Delta tables that every Fabric engine can read: Spark, the SQL analytics endpoint and Power BI.
The file
The lessons use a CSV of orders with these columns:
OrderID,OrderDate,CustomerID,CustomerName,Country,Product,Quantity,Amount
10241,2026-03-02,C-118,Muster Bau,Austria,Cable 3m,4,59.60
10242,2026-03-02,C-204,Beispiel GmbH,Germany,Switch 24p,1,389.00Any export of orders with these columns works. In the lakehouse, open Files, make a folder raw/orders and upload the file into it.
The notebook
Select New notebook from the lakehouse, so it opens with the lakehouse attached, and run:
from pyspark.sql import functions as F
raw = (spark.read
.option("header", True)
.csv("Files/raw/orders/"))
bronze = (raw
.withColumn("_loaded_at", F.current_timestamp())
.withColumn("_source_file", F.input_file_name()))
bronze.write.mode("append").saveAsTable("bronze_orders")Three choices in those lines are on purpose:
- No schema inference. Every column stays text in bronze. A date the source wrote badly is kept as it was, instead of turning into an empty value nobody can explain.
- Two columns of our own.
_loaded_atand_source_filesay when each row came and from which file. The underscore marks them as added by the platform. - Append. Each run adds what arrived. Loading the same file twice gives duplicates in bronze, and that is fine: silver takes care of them.
Look at it
display(spark.sql("""
SELECT _source_file, COUNT(*) AS row_count, MAX(_loaded_at) AS loaded
FROM bronze_orders
GROUP BY _source_file
"""))The table also shows under Tables in the lakehouse, and the SQL analytics endpoint can query it straight away.