Search before asking
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).
Anything Else?
No response
Are you willing to submit PR?
Code of Conduct
Search before asking
Version
master, latest version
What's Wrong?
The result returned by
show create materialized viewis 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 mv
show create mv
The output is
PARTITION BY (date_trunc(month_dt, 'month'))while the input ispartition by (month_dt).Anything Else?
No response
Are you willing to submit PR?
Code of Conduct