[decimal](tests) add test case for least/greatest for decimalv3 type (#26930)

This commit is contained in:
TengJianPing
2023-11-17 12:09:59 +08:00
committed by GitHub
parent 91af86bc78
commit 4ac460af28
2 changed files with 21 additions and 0 deletions

View File

@ -323,3 +323,10 @@ zzz
zzz
zzz
-- !decimalv3_scale0 --
12.34
34.45
-- !decimalv3_scale1 --
23.45
45.56

View File

@ -116,6 +116,20 @@ suite("test_least_greatest") {
qt_select "SELECT GREATEST('zzz', v5) FROM test_least_greatest order by k1"
sql """ drop table if exists test_least_greatest; """
sql """ drop table if exists test_least_greatest2; """
sql """
CREATE TABLE `test_least_greatest2` (
id int,
name1 decimalv3(9,2),
name2 decimalv3(9,2)
) DISTRIBUTED BY HASH(id) BUCKETS 1
PROPERTIES ( "replication_allocation" = "tag.location.default: 1");
"""
sql """insert into test_least_greatest2 values(1, 12.34, 23.45), (2, 34.45, 45.56);"""
sql "sync"
qt_decimalv3_scale0 " select least(name1, name2) from test_least_greatest2 order by name1, name2;"
qt_decimalv3_scale1 " select greatest(name1, name2) from test_least_greatest2 order by name1, name2;"
}