-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix](decimalv2) fix decimalv2 agg errors
- Loading branch information
Showing
11 changed files
with
233 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
regression-test/data/datatype_p0/decimalv2/test_decimalv2_agg.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !decimalv2_min -- | ||
-123456789012345678.901234567 | ||
|
||
-- !decimalv2_max -- | ||
123456789012345678.901234567 | ||
|
||
-- !decimalv2_count -- | ||
3 | ||
|
||
-- !decimalv2_sum -- | ||
0.012345679 | ||
|
||
-- !decimalv2_avg -- | ||
0.004115226 | ||
|
||
-- !decimalv2_sum2 -- | ||
1000000000000000000.000000000 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
regression-test/suites/datatype_p0/decimalv2/test_decimalv2_agg.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
suite("test_decimalv2_agg", "nonConcurrent") { | ||
|
||
sql """ | ||
admin set frontend config("enable_decimal_conversion" = "false"); | ||
""" | ||
|
||
sql """ | ||
drop table if exists test_decimalv2_agg; | ||
""" | ||
sql """ | ||
create table test_decimalv2_agg ( | ||
k1 decimalv2(27,9) | ||
)distributed by hash(k1) | ||
properties("replication_num"="1"); | ||
""" | ||
sql """ | ||
insert into test_decimalv2_agg values | ||
(123456789012345678.901234567), | ||
(-123456789012345678.901234567), | ||
(0.012345679), | ||
(NULL); | ||
""" | ||
qt_decimalv2_min " select min(k1) from test_decimalv2_agg; " | ||
qt_decimalv2_max " select max(k1) from test_decimalv2_agg; " | ||
qt_decimalv2_count " select count(k1) from test_decimalv2_agg; " | ||
qt_decimalv2_sum " select sum(k1) from test_decimalv2_agg; " | ||
qt_decimalv2_avg " select avg(k1) from test_decimalv2_agg; " | ||
|
||
// test overflow | ||
sql """ | ||
drop table if exists test_decimalv2_agg; | ||
""" | ||
sql """ | ||
create table test_decimalv2_agg ( | ||
k1 decimalv2(27,9) | ||
)distributed by hash(k1) | ||
properties("replication_num"="1"); | ||
""" | ||
sql """ | ||
insert into test_decimalv2_agg values | ||
(999999999999999999.999999999), | ||
(0.000000001), | ||
(NULL); | ||
""" | ||
qt_decimalv2_sum2 " select sum(k1) from test_decimalv2_agg; " | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.