Skip to content

[spark] Support CREATE and REFRESH MATERIALIZED VIEW for Data Evolution - #11544

Open
JingsongLi wants to merge 12 commits into
apache:masterfrom
JingsongLi:codex/paimon-spark-row-refresh
Open

JingsongLi wants to merge 12 commits into
apache:masterfrom
JingsongLi:codex/paimon-spark-row-refresh

Conversation

@JingsongLi

@JingsongLi JingsongLi commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Add dedicated Spark SQL commands for a materialized view over one Paimon Data Evolution table.

CREATE MATERIALIZED VIEW paimon.default.pose_mv AS
SELECT id, try_variant_get(payload, '$.pose', 'array<float>') AS pose
FROM events WHERE enabled;

REFRESH MATERIALIZED VIEW paimon.default.pose_mv;

Creation derives the schema from the SELECT, creates a ROW Data Evolution backing table with deletion vectors, and populates it synchronously. The Spark relation exposes the SELECT output columns. The stored query and internal source row IDs let the Java refresher apply changes to the affected target rows. Each refresh publishes the data and source progress in the same target snapshot.

The first version supports a deterministic SELECT with an optional WHERE clause over one physical Data Evolution source. The Spark Materialized Views guide documents creation and refresh in a separate commit.

This extracts the single-source Spark entry point from #11515 and builds on #11540.

Tests

  • Spark 4.1 packaging passed 40 Scala tests and 23 Java planner and refresher tests.
  • SQL coverage includes synchronous creation, cached reads after refresh, partial-column updates, DV deletes, MERGE, overwrite, partition drop, truncate, schema-only changes, row-ID rewrites, and nested and dedicated BLOB and vector files. The tests check target rows and source snapshot progress.
  • The shared Spark module packaged with the Spark 3 profile.
  • The Docusaurus documentation build passed.

@JingsongLi JingsongLi changed the title [spark] Refresh single-source ROW materializations with SQL [spark] Support CREATE and REFRESH MATERIALIZED VIEW for Data Evolution Nov 30, 2026
@JingsongLi
JingsongLi force-pushed the codex/paimon-spark-row-refresh branch from ea48e5d to 4b67393 Compare November 30, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant