基表
CREATE TABLE `t1` (
`k1` LARGEINT NOT NULL,
`k2` DATE NOT NULL
) ENGINE=OLAP
DUPLICATE KEY(`k1`)
DISTRIBUTED BY RANDOM BUCKETS 3
CREATE TABLE `t2` (
`k1` LARGEINT NOT NULL,
`k3` DATE NOT NULL
) ENGINE=OLAP
DUPLICATE KEY(`k1`)
DISTRIBUTED BY RANDOM BUCKETS 3
创建物化视图
SET global enable_nereids_planner = true;
CREATE MATERIALIZED VIEW mv1
BUILD IMMEDIATE
REFRESH COMPLETE ON 'COMMIT'
DISTRIBUTED BY HASH keys=k1 BUCKETS 10 AS
SELECT
t1.k1, t2.k3
FROM t1 LEFT JOIN t2 ON t1.k1=t2.k1
错误
Execution failed: Error Failed to execute sql: org.apache.doris.common.AnalysisException: errCode = 2, detailMessage = Syntax error in line 2: ...ATERIALIZED VIEW mv1 BUILD IMMEDIATE REFRESH COMP... ^ Encountered: BUILD Expected