V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
9921
V2EX  ›  程序员

Apache Doris 物化视图的问题

  •  
  •   9921 · 2023-10-12 11:16:09 +08:00 · 932 次点击
    这是一个创建于 407 天前的主题,其中的信息可能已经有所发展或是发生改变。

    想创建个分组统计数据行数的物化视图 CREATE MATERIALIZED VIEW view_kafka_yc_gps_info as select user_id, to_date(gdt) as summary_date, count(0) as data_count from kafka_yc_gps_info group by user_id,summary_date order by user_id,summary_date; 报错如下: Execution failed: Error Failed to execute sql: java.sql.SQLException: (conn=142) errCode = 2, detailMessage = The materialized view contain constant expr is disallowed, expr: count(0) 查询语句可以正常执行: select user_id, to_date(gdt) as summary_date, count(0) as data_count from kafka_yc_gps_info group by user_id,summary_date order by user_id,summary_date;

    9921
        1
    9921  
    OP
       2023-10-12 11:34:43 +08:00
    物化视图限制有点多啊,MergeOnWrite table can't create materialized view
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3663 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 05:08 · PVG 13:08 · LAX 21:08 · JFK 00:08
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.