You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Incorrect result of show create MTMV when partition by date_trunc alias #62910
I had searched in the issues and found no similar issues.
Version
master, latest version
What's Wrong?
The result returned by show create materialized view is inconsistent with the initial creation statement.
What You Expected?
The input and output of the creation statement shouled keep consistent.
How to Reproduce?
create table
CREATE TABLE test (
`k1` LARGEINT NOT NULL,
`k2` DATE NOT NULL
) ENGINE=OLAP
DUPLICATE KEY(`k1`)
COMMENT 'OLAP'
PARTITION BY range(`k2`)
(
PARTITION p_20200101 VALUES [("2020-01-01"),("2020-01-02")),
PARTITION p_20200102 VALUES [("2020-01-02"),("2020-01-03")),
PARTITION p_20200201 VALUES [("2020-02-01"),("2020-02-02"))
)
DISTRIBUTED BY HASH(`k1`) BUCKETS 2
PROPERTIES ('replication_num' = '1') ;
create mv
CREATE MATERIALIZED VIEW mv_month
BUILD DEFERRED REFRESH AUTO ON MANUAL
partition by (month_dt)
DISTRIBUTED BY RANDOM BUCKETS 2
PROPERTIES (
'replication_num' = '1'
)
AS select date_trunc(`k2`, 'month') as month_dt, k1 from test;
show create mv
CREATE MATERIALIZED VIEW mv_month
(month_dt,k1)
BUILD DEFERRED REFRESH AUTO ON MANUAL
DUPLICATE KEY(`month_dt`, `k1`)
PARTITION BY (date_trunc(`month_dt`, 'month'))
DISTRIBUTED BY RANDOM BUCKETS 2
PROPERTIES (
"replication_allocation" = "tag.location.default: 1",
"min_load_replica_num" = "-1",
"is_being_synced" = "false",
"storage_medium" = "hdd",
"storage_format" = "V2",
"inverted_index_storage_format" = "V3",
"light_schema_change" = "true",
"disable_auto_compaction" = "false",
"enable_single_replica_compaction" = "false",
"group_commit_interval_ms" = "10000",
"group_commit_data_bytes" = "134217728"
)
AS select date_trunc(`internal`.`test`.`test`.`k2`, 'month') as `month_dt`, `internal`.`test`.`test`.`k1` from `internal`.`test`.`test`
The output is PARTITION BY (date_trunc(month_dt, 'month')) while the input is partition by (month_dt).
We're closing this issue because it hasn't been updated in a while.
If you'd like to revive this issue, please reopen it and feel free a maintainer to remove the Stale tag!
Activity
github-actions commentedon Oct 26, 2026
We're closing this issue because it hasn't been updated in a while.
If you'd like to revive this issue, please reopen it and feel free a maintainer to remove the Stale tag!