-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Data table for MatView behaves strangely when MV moved from Ordinary to Atomic DB #23926
Copy link
Copy link
Closed
Labels
comp-materialized-viewMaterialized views: insert-triggered MV pipeline, insert dependencies, deduplication.Materialized views: insert-triggered MV pipeline, insert dependencies, deduplication.unexpected behaviourResult is unexpected, but not entirely wrong at the same time.Result is unexpected, but not entirely wrong at the same time.
Description
Describe the unexpected behaviour
When MatView is moved from Ordinary DB to Atomic, data table stays in the same DB but renamed. I'd expected it moved to another DB too. Or at least not renamed and moved separately.
How to reproduce
- Which ClickHouse server version to use: 21.3.9
- Which interface to use, if matters: doesn't matter
- Full reproduction SQL:
CREATE DATABASE IF NOT EXISTS ordinary ENGINE=Ordinary;
CREATE DATABASE IF NOT EXISTS atomic ENGINE=Atomic;
CREATE TABLE IF NOT EXISTS ordinary.data (s String) ENGINE=MergeTree() PARTITION BY tuple() ORDER BY s;
CREATE MATERIALIZED VIEW IF NOT EXISTS ordinary.mv (s String) ENGINE=MergeTree() PARTITION BY tuple() ORDER BY s AS SELECT * FROM ordinary.data;
SELECT 'ordinary:';
SHOW TABLES FROM ordinary;
RENAME TABLE ordinary.mv TO atomic.mv;
SELECT 'ordinary after rename:';
SHOW TABLES FROM ordinary;
SELECT 'atomic after rename:';
SHOW TABLES FROM atomic;Output:
ordinary:
.inner.mv
data
mv
ordinary after rename:
.inner_id.d9584e69-6200-440f-a82d-3f8e5e18ff5e
data
atomic after rename:
mv
Expected behavior
Either .inner.mv stays as is in Ordinary DB or moved together with mv to the Atomic DB
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
comp-materialized-viewMaterialized views: insert-triggered MV pipeline, insert dependencies, deduplication.Materialized views: insert-triggered MV pipeline, insert dependencies, deduplication.unexpected behaviourResult is unexpected, but not entirely wrong at the same time.Result is unexpected, but not entirely wrong at the same time.