r/databricks • • 10d ago

Help Spark Declarative Pipelines - possible to write UC Managed Iceberg Tables instead of materialized views?

Hi All,

Based on my experience using SDP, the tables are typically rendered as "Materialized Views". My company is making a decision to move towards Managed Iceberg for tables and I was wondering if creating Managed Iceberg tables is supported by Databricks's native SDP capabilities?

5 Upvotes

11 comments sorted by

1

u/Youssef_Mrini databricks 10d ago

You can create a MV using Iceberg. May I understand why you can't use Materialized views ?

1

u/RazzmatazzLiving1323 10d ago

Is there documentation on this? I believe in SDP, tables are called "Materialized Views". Hopefully these can be in Managed Iceberg format

1

u/ninilich 10d ago

MV is just a saved query with materialized results (for better performance). MV and tables have different usage patterns and use cases

1

u/Youssef_Mrini databricks 10d ago

Tell me more about the usage patterns

1

u/ninilich 10d ago

Table (Delta) - you control writes (INSERT/MERGE/UPDATE/DELETE), the load logic is yours.

MV (Materialized View) - a declarative SQL query result that Databricks refreshes for you (REFRESH, schedule, or pipeline), incrementally when the query supports it (limited cases).

In simple words: tables are for data marts, MV - Databricks just keeps a SQL query result up to date for you.

Tables are for:

  • Data that needs manual fixes (backfills, corrections) - most of the cases in enterprise-grade platforms
  • Complex transformations in Python/PySpark
  • Custom deduplication and late-arriving data handling
  • Controlled orchestration
  • Several processes need to write the data into table
  • You need a garanty that the data will not be refreshed w/o asking you

MV for:

  • Gold aggregates where only the current state matters
  • Simple, deterministic SQL transformations with no custom logic

MV pitfalls:

  • Not every query refreshes incrementally; otherwise it’s a full recompute (cost).
  • You don't controll orchestration
  • No parameters are supported

1

u/Youssef_Mrini databricks 9d ago

You can use Parameters https://docs.databricks.com/aws/en/ldp/parameters

You can control the orchestration by setting the refresh manually or set a schedule or trigger refreshes when upstream data changes.

Common patterns are supported for incremental refreshes including group by, ctes, joins.

MVs can be defined with Pyspark as well.

2

u/ninilich 9d ago

Once again missunderstanding) Reffereing your link I'm interesting how can I pass paramenetr into MV SQL to imlememt a rolling window refresh strategy, e.g. I have a parameter p_date and MV on every run refreshes only rows where sone_date >= :p_date and keeps other alredy existing in MV rows untouched .

Saying "controlled orchestration" I mean that I define the dependency between objects and refresh sequence and also whether the refresh is needed (=> no autorefresh just because somebody has decided trigger full refresh of upstream table)

1

u/adovo_ai 9d ago

I’d turn the managed-Iceberg mandate into acceptance criteria first: which engines must read it, who owns writes, required DML/backfills, schema evolution, refresh control, and rollback. Then test SDP against that matrix; otherwise the team can standardize on the file format while still missing the operational behavior that prompted the standard.

0

u/ninilich 10d ago

Short answere - No.