Skip to content

Writing chunked text into Delta Lake tables in Unity Catalog

After splitting source documents into chunks, the chunks must be loaded into a Spark DataFrame and written as a managed Delta table registered in a Unity Catalog catalog and schema, typically to serve as the source table for a downstream Vector Search index. The write step uses standard Spark/Delta APIs but requires attention to UC three-level naming, schema design, and Change Data Feed settings.

1 · Learn the must-know

  • Convert the list of chunked text (with associated metadata like source, chunk id) into a Spark DataFrame before writing, e.g. via spark.createDataFrame().
  • Write the DataFrame to a Delta table using the three-level Unity Catalog namespace catalog.schema.table, e.g. df.write.mode("overwrite"/"append").saveAsTable("catalog.schema.table").
  • Include a unique primary-key/id column per chunk row, since Databricks Vector Search indexes require a designated primary key column on the source Delta table.
  • Enable Change Data Feed on the table (TBLPROPERTIES (delta.enableChangeDataFeed = true)) if the table will sync incrementally to a Vector Search index.
  • The user/service principal must have USE CATALOG, USE SCHEMA, and CREATE TABLE privileges on the target Unity Catalog location before the write will succeed.
  • Prefer append or merge for incremental chunk ingestion and overwrite only for full reprocessing, to avoid breaking downstream index sync or duplicating chunks.

2 · Check your understanding

Check this objectiveFree · always available

A team chunks PDF documents into passages of up to 512 tokens and must give each chunk a unique identifier before writing to a Unity Catalog Delta table that will back a Vector Search index. They are deciding how to generate and register this identifier during the write step. Which approach should the team take?

Your objective map0 tried · 0 answered correctly · 56 untouched

What you have tried across Databricks GenAI Engineer's objectives, not a readiness score.

Design Applications10.71% of the exam*0 of 6 tried
Data Preparation14.29% of the exam*0 of 8 tried
Application Development23.21% of the exam*0 of 13 tried
Assembling and Deploying Applications26.79% of the exam*0 of 15 tried
Governance7.14% of the exam*0 of 4 tried
Evaluation and Monitoring17.86% of the exam*0 of 10 tried

* Our estimate. Databricks publishes no section weights.

3 · Keep going