Editing Lakehouse Data

Introduction to Microsoft Fabric

Alex Kuntz

Technical Instructional Designer

Read-Only lakehouses

  • SQL Analytics Engine is read-only

Read-only SQL analytics endpoints created for each Lakehouse. Warehouses can use SQL for read and write access.

1 https://learn.microsoft.com/en-us/fabric/data-warehouse/data-warehousing
Introduction to Microsoft Fabric

Data Manipulation Language (DML) Statements

  • SQL keywords that involve updating table data
    • UPDATE
    • INSERT
    • DELETE
  • The SQL Analytics Endpoint is for analysis, not manipulation!
Introduction to Microsoft Fabric

DML statements in notebooks: Spark SQL

  • Notebooks can be used to edit lakehouse data!
  • Spark SQL cells in notebooks can execute DML statements.

An example of a DML statement in a Spark SQL cell

Introduction to Microsoft Fabric

DML statements in notebooks: PySpark

  • PySpark cells in a notebook can execute DML statements
  • overwrite mode
    df.write.mode("overwrite").format("delta").saveAsTable(table)
    
  • append mode
    new_rows_df.write.mode("append").format("delta").saveAsTable(table)
    
  • Don't worry about Python or SQL syntax for this course!
Introduction to Microsoft Fabric

Let's practice!

Introduction to Microsoft Fabric

Preparing Video For Download...