Skip to content

Conversation

@jasonhernandez
Copy link

Description of changes

Adds a Materialize backend for Ibis

This PR introduces a new backend for Materialize, a live data layer with native support for generalized incremental view maintenance. Materialize strives to maintain PostgreSQL wire compatibility, but it offers a number of unique capabilities that require expanding beyond the existing Postgres backend for Materialize users. In particular, Materialize provides:

  • Indexes on views, enabling fast, incremental computation over complex SQL queries.
  • Robust materialized view support
  • Clusters for providing physical workload isolation between multiple concurrent use cases within the same database.

The Materialize team is excited to collaborate with the Ibis community and is committed to maintaining and improving this backend going forward.

@github-actions github-actions bot added docs Documentation related issues or PRs tests Issues or PRs related to tests ci Continuous Integration issues or PRs dependencies Issues or PRs related to dependencies sql Backends that generate SQL labels Oct 17, 2025
@jasonhernandez jasonhernandez force-pushed the feat/add-Materialize-backend branch 4 times, most recently from 35b0a11 to 349400c Compare October 20, 2025 17:24
@cpcloud
Copy link
Member

cpcloud commented Oct 24, 2025

@jasonhernandez Thanks for the PR! I will try to give it a review this weekend or later this evening.

It looks like the materialize test suite is timing out at 60 minutes. Any idea what's going on there?

Copy link
Member

@cpcloud cpcloud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good! This is one of the most thorough initial backend PRs I've ever seen, great work.

A few comments, mostly around exception handling and too-broad-try clauses.

@jasonhernandez jasonhernandez force-pushed the feat/add-Materialize-backend branch 3 times, most recently from 39004fc to 46a9f19 Compare November 14, 2025 22:42
@jasonhernandez
Copy link
Author

@jasonhernandez Thanks for the PR! I will try to give it a review this weekend or later this evening.

It looks like the materialize test suite is timing out at 60 minutes. Any idea what's going on there?

I was hoping you might have known of something obvious that might cause that timeout. I'm going to investigate it further.
I was out over the past few weeks - back at things now for a good while.

@jasonhernandez jasonhernandez force-pushed the feat/add-Materialize-backend branch 2 times, most recently from 7e62c90 to bf29fa1 Compare November 15, 2025 02:42
@def- def- force-pushed the feat/add-Materialize-backend branch 13 times, most recently from e130a91 to e410ec0 Compare November 20, 2025 20:23
@jasonhernandez jasonhernandez force-pushed the feat/add-Materialize-backend branch 8 times, most recently from 8cdab23 to 1f2df71 Compare November 24, 2025 22:45
interval: 2s
retries: 30
timeout: 5s
test: ["CMD", "curl", "-f", "localhost:6878/api/readyz"]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is our recommended healthcheck endpoint

@jasonhernandez
Copy link
Author

jasonhernandez commented Nov 24, 2025

@cpcloud I added two commits - the first one specifically addresses the feedback on this review. The second one makes some fixes to testing (resolving the timeouts of the backend test), bumps to the latest version of Materialize, and generally incorporates recommendations from our head of QA.
Let me know if you have any additional feedback or recommendations.

I can squash these all together / submit a new PR or change this however would simplify review / merging on your end.

jasonhernandez and others added 3 commits December 3, 2025 10:18
This commit adds comprehensive support for Materialize, including:
- Core backend implementation with cluster and connection management
- Support for materialized views, indexes, sources, sinks, and secrets
- Idiomatic Materialize SQL patterns (mz_now(), SUBSCRIBE, etc.)
- Test coverage for Materialize-specific features
- Integration with existing Ibis test suite

Co-Authored-By: Seth Wiesman <[email protected]>
This commit addresses several issues to improve Materialize test reliability:

- Update to Materialize v26 syntax: Replace deprecated COUNTER load generator
  with AUCTION, update to FOR ALL TABLES syntax for multi-output sources
- Fix test parallelization: Serialize array, source, and subscribe tests to
  avoid resource contention and subsource name collisions
- Optimize data loading: Cache list_tables() result during CSV loading to
  reduce expensive database calls
- Fix doctest failures: Reduce to 54 doctest +SKIP markers matching postgres
  backend pattern (68% reduction)
- Fix dead fixture warnings: Mark TPC benchmark tests as skipped instead of
  deselecting them to prevent pytest-deadfixtures from flagging their fixtures
- Fix test_map: Make assertion Materialize-specific to avoid breaking other
  backends' pytest diff output
- Remove deprecated enable_load_generator_counter and
  enable_create_table_from_source flags from compose.yaml

Co-Authored-By: Dennis Felsing <[email protected]>
@jasonhernandez jasonhernandez force-pushed the feat/add-Materialize-backend branch from 1f2df71 to 4dca804 Compare December 3, 2025 18:18
@jasonhernandez
Copy link
Author

@cpcloud I just wanted to check when you might have a chance to look at this PR again. I know it's rather massive.
I just rebased it on main, which I'm happy to do again whenever it might help.

jasonhernandez and others added 2 commits December 4, 2025 10:57
Materialize does not support MERGE INTO syntax, which the upsert()
method uses. This commit marks the upsert tests with pytest.mark.notyet
for materialize, similar to how other backends that don't support
MERGE INTO are handled (risingwave, mysql, sqlite, etc.).

The following tests are now expected failures for Materialize:
- test_upsert_from_dataframe
- test_upsert_from_memtable (all variants)
- test_upsert_from_expr (both variants)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continuous Integration issues or PRs dependencies Issues or PRs related to dependencies docs Documentation related issues or PRs sql Backends that generate SQL tests Issues or PRs related to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants