Skip to content

Writing transform logic in PySpark, SQL, or KQL

In Microsoft Fabric, you can transform data using PySpark and SQL in Notebooks against Lakehouse tables/files, and using KQL in KQL Queryset (or update policies) against Eventhouse/KQL databases. Choosing the right language and engine depends on the data store (Lakehouse vs. Eventhouse), the data format, and whether you need distributed batch processing, declarative SQL transforms, or near-real-time analytical queries.

1 · Learn the must-know

  • Fabric Notebooks support PySpark, Spark SQL, Scala, and SparkR (via %%language magic cells), letting you mix PySpark DataFrame operations with SQL queries in the same notebook against Lakehouse tables and files.
  • PySpark DataFrame transformations (select, filter, withColumn, groupBy, join, etc.) execute lazily and are optimized/executed by the Spark engine only when an action (e.g., show, write, count) is triggered.
  • You can register a DataFrame as a temporary view (createOrReplaceTempView) to run Spark SQL statements against it, or query Lakehouse Delta tables directly with SQL using spark.sql().
  • T-SQL against the SQL analytics endpoint of a Lakehouse or a Warehouse is read/query-focused for the Lakehouse endpoint (no DML), whereas the Warehouse supports full T-SQL DML (INSERT/UPDATE/DELETE/MERGE) for transformations.
  • KQL (Kusto Query Language) is used to query and transform data in Eventhouse/KQL databases via the KQL Queryset, using operators like extend, project, summarize, and mv-expand for filtering, shaping, and aggregating streaming or log-style data.
  • Update policies in a KQL database let you automatically transform and route incoming data from a source table into one or more target tables using a KQL function, enabling lightweight ETL within the Eventhouse without moving data to Spark.

2 · Check your understanding

Check this objectiveFree · always available

A data engineer is transforming a lakehouse table in a Fabric notebook using PySpark. The source table contains a column named Items that stores an array of struct values (ProductId, Quantity) for each order. The engineer needs to produce one output row per item while keeping the other order-level columns (OrderId, OrderDate) unchanged for each resulting row. Which transformation should the engineer apply to the DataFrame?

Your objective map0 tried · 0 answered correctly · 54 untouched

What you have tried across DP-700's objectives, not a readiness score.

Implement and manage an analytics solution30-35% of the exam0 of 18 tried
Ingest and transform data30-35% of the exam0 of 19 tried
Monitor and optimize an analytics solution30-35% of the exam0 of 17 tried

3 · Keep going