forked from StarRocks/starrocks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BugFix] make max_by/min_by's output result column always nullable (S…
…tarRocks#55116) Signed-off-by: before-Sunrise <[email protected]>
- Loading branch information
1 parent
47e386b
commit c42afe2
Showing
3 changed files
with
70 additions
and
2 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
36 changes: 36 additions & 0 deletions
36
test/sql/test_max_min_by_not_filter_nulls_with_nulls/R/test_max_min_by_with_empty_table
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,36 @@ | ||
-- name: test_max_min_by_with_empty_table | ||
CREATE TABLE `primary_table_with_null_partition` ( | ||
`k1` date not null, | ||
`k2` datetime not null, | ||
`k3` varchar(20) not null, | ||
`k4` varchar(20) not null, | ||
`k5` boolean not null, | ||
`v1` tinyint, | ||
`v2` smallint, | ||
`v3` int, | ||
`v4` bigint, | ||
`v5` largeint, | ||
`v6` float, | ||
`v7` double, | ||
`v8` decimal(27,9) | ||
) | ||
PRIMARY KEY(`k1`, `k2`,`k3`) | ||
COMMENT "OLAP" | ||
PARTITION BY RANGE(`k1`) | ||
( | ||
PARTITION `p202006` VALUES LESS THAN ("2020-07-01"), | ||
PARTITION `p202007` VALUES LESS THAN ("2020-08-01"), | ||
PARTITION `p202008` VALUES LESS THAN ("2020-09-01") | ||
) | ||
DISTRIBUTED BY HASH(`k1`, `k2`) BUCKETS 3 | ||
PROPERTIES ( | ||
"replication_num" = "1", | ||
"enable_persistent_index" = "true", | ||
"storage_format" = "v2" | ||
); | ||
-- result: | ||
-- !result | ||
select max_by(k1,k1) from primary_table_with_null_partition; | ||
-- result: | ||
None | ||
-- !result |
32 changes: 32 additions & 0 deletions
32
test/sql/test_max_min_by_not_filter_nulls_with_nulls/T/test_max_min_by_with_empty_table
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,32 @@ | ||
-- name: test_max_min_by_with_empty_table | ||
CREATE TABLE `primary_table_with_null_partition` ( | ||
`k1` date not null, | ||
`k2` datetime not null, | ||
`k3` varchar(20) not null, | ||
`k4` varchar(20) not null, | ||
`k5` boolean not null, | ||
`v1` tinyint, | ||
`v2` smallint, | ||
`v3` int, | ||
`v4` bigint, | ||
`v5` largeint, | ||
`v6` float, | ||
`v7` double, | ||
`v8` decimal(27,9) | ||
) | ||
PRIMARY KEY(`k1`, `k2`,`k3`) | ||
COMMENT "OLAP" | ||
PARTITION BY RANGE(`k1`) | ||
( | ||
PARTITION `p202006` VALUES LESS THAN ("2020-07-01"), | ||
PARTITION `p202007` VALUES LESS THAN ("2020-08-01"), | ||
PARTITION `p202008` VALUES LESS THAN ("2020-09-01") | ||
) | ||
DISTRIBUTED BY HASH(`k1`, `k2`) BUCKETS 3 | ||
PROPERTIES ( | ||
"replication_num" = "1", | ||
"enable_persistent_index" = "true", | ||
"storage_format" = "v2" | ||
); | ||
|
||
select max_by(k1,k1) from primary_table_with_null_partition; |