superdiaodiao commented on code in PR #43422:
URL: https://github.com/apache/doris/pull/43422#discussion_r1832542815
##########
regression-test/suites/nereids_p0/expression/fold_constant/fold_constant_numeric_arithmatic.groovy:
##########
@@ -409,4 +409,13 @@ test {
//Additional cases for Xor, Conv, and other mathematical functions
testFoldConst("SELECT CONV(-10, 10, 2) AS conv_invalid_base") //Conv with
negative input (may be undefined)
+
+ // fix floor/ceil/round function return type with DecimalV3 input
+ testFoldConst("with cte as (select floor(300.343) order by 1 limit 1)
select * from cte")
+ testFoldConst("with cte as (select round(300.343) order by 1 limit 1)
select * from cte")
+ testFoldConst("with cte as (select ceil(300.343) order by 1 limit 1)
select * from cte")
+
+ testFoldConst("with cte as (select floor(300.343, 2) order by 1 limit 1)
select * from cte")
+ testFoldConst("with cte as (select round(300.343, 2) order by 1 limit 1)
select * from cte")
+ testFoldConst("with cte as (select ceil(300.343, 2) order by 1 limit 1)
select * from cte")
Review Comment:
I tested the query before this PR:
`with cte as (select truncate(300.343, 2) order by 1 limit 1) select * from
cte;`,
and the exception is:
`ERROR 1105 (HY000): errCode = 2, detailMessage =
(9.134.238.135)[INTERNAL_ERROR]output type not match expr type , col name ,
expected type Decimal(6, 2) , real type Decimal(5, 2)`.
So whether the truncate() should be tested together?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]