Feature: Materialized Views support external storage

Open
#20,810 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@TCeason is already working on this.

Since Oct 23, 2026.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
databases, rust, sql
Domain
backend, database

Research direction

Start with src/query/sql/src/planner/binder/ddl/materialized_view.rs and its TODO about DEFAULT_STORAGE_CONNECTION and DEFAULT_STORAGE_PATH; compare the external storage setup for base tables. Then trace materialized view refresh, vacuum/GC, fail-safe, creation-time storage checks, and storage class options. Done means views use their own database or options for external storage and storage class, with those operations and checks working as described.

Written by the indexing model from the issue text.

Description

C-feature

Summary

Materialized Views are always created on the default (internal) storage:
src/query/sql/src/planner/binder/ddl/materialized_view.rs sets storage_params = None
(see the TODO there about honoring DEFAULT_STORAGE_CONNECTION/DEFAULT_STORAGE_PATH).

Expected: a Materialized View created in a database with default storage connection/path is stored
there like base tables, and therefore inherits DEFAULT_S3_STORAGE_CLASS and accepts
S3_STORAGE_CLASS (CREATE / ALTER ... SET OPTIONS) per #20689.

Points to cover:

  • refresh, vacuum/GC and fail-safe work with external storage;
  • storage access check at creation time, as for external base tables;
  • storage class follows the MV's own database/options, not its source tables.

Part of #20809.

Dominant language
Rust
Stars
9.5k
Forks
903
Avg merge
2d 13h
Merged PRs (30d)
204

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from databendlabs/databend

All issues in databendlabs/databend

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.