使用 DECIMAL 查询出错

Viewed 46

版本 2.1.5

建表语句:
CREATE TABLE test (
a TINYINT NULL DEFAULT "0",
t DATETIME NOT NULL COMMENT '',
c DECIMAL(18, 2) SUM NULL DEFAULT "0"
)ENGINE = OLAP AGGREGATE KEY
(a,t)
PARTITION BY RANGE(t) ()
DISTRIBUTED BY random buckets 1
PROPERTIES
(
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "HOUR",
"dynamic_partition.start" = "-3",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "1",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.create_history_partition" = "true",
"dynamic_partition.history_partition_num" = "3",
"light_schema_change" = "true"
);

插入两条数据:

insert into test VALUES (1,'2024-08-28 17:20:00', 9999999999999999.99);
insert into test VALUES (2,'2024-08-28 17:20:00', 9999999999999999.99);

select * 能查询出结果, select c字段报错 output type not match expr type , col name c , expected type Nullable(Decimal(18, 2)) , real type Nullable(Decimal(38, 2))

image.png

1 Answers

【问题状态】已记录
【问题处理】2.1.7fix:https://github.com/apache/doris/pull/40181
【临时方案】新老优化器兼容问题导致,该case可以先会话级关闭新优化器查询
SET enable_nereids_planner=false;