liaoxin01 opened a new pull request, #42067:
URL: https://github.com/apache/doris/pull/42067
Aggregating string types with null values may result in incorrect result.
CREATE TABLE `test_scan_keys_with_bool_type` (
`col1` tinyint NOT NULL,
`col2` int NOT NULL,
`col3` tinyint NOT NULL,
`col5` boolean REPLACE NOT NULL,
`col4` datetime(2) REPLACE NOT NULL,
`col6` double REPLACE_IF_NOT_NULL NULL,
`col7` varchar(100) REPLACE_IF_NOT_NULL NULL
) ENGINE=OLAP
AGGREGATE KEY(`col1`, `col2`, `col3`)
DISTRIBUTED BY HASH(`col1`, `col2`, `col3`) BUCKETS 1
PROPERTIES (
"replication_allocation" = "tag.location.default: 1",
"disable_auto_compaction" = "true"
);
insert into test_scan_keys_with_bool_type values
( -100 , 1 , -82 , 1 , '2024-02-16 04:37:37.00' , -1299962421.904282
, NULL ),
( -100 , 0 , -82 , 1 , '2024-02-16 04:37:37.00' , -1299962421.904282
, "hi" ),
( -100 , 1 , 92 , 1 , '2024-02-16 04:37:37.00' , 23423423.0324234
, NULL );
insert into test_scan_keys_with_bool_type values
( -100 , 1 , 1 , 1 , '2024-02-16 04:37:37.00' , -1299962421.904282 ,
"doris" );
MySQL [test]> select * from test_scan_keys_with_bool_type;
+------+------+------+------+------------------------+---------------------+-------+
| col1 | col2 | col3 | col5 | col4 | col6 |
col7 |
+------+------+------+------+------------------------+---------------------+-------+
| -100 | 0 | -82 | 1 | 2024-02-16 04:37:37.00 | -1299962421.9042821 |
hi |
| -100 | 1 | -82 | 1 | 2024-02-16 04:37:37.00 | -1299962421.9042821 |
NULL |
| -100 | 1 | 1 | 1 | 2024-02-16 04:37:37.00 | -1299962421.9042821 |
hidor |
| -100 | 1 | 92 | 1 | 2024-02-16 04:37:37.00 | 23423423.0324234 |
NULL |
+------+------+------+------+------------------------+---------------------+-------+
4 rows in set (0.057 sec)
MySQL [test]> set skip_storage_engine_merge = true; select * from
test_scan_keys_with_bool_type;
+------+------+------+------+------------------------+---------------------+-------+
| col1 | col2 | col3 | col5 | col4 | col6 |
col7 |
+------+------+------+------+------------------------+---------------------+-------+
| -100 | 0 | -82 | 1 | 2024-02-16 04:37:37.00 | -1299962421.9042821 |
hi |
| -100 | 1 | -82 | 1 | 2024-02-16 04:37:37.00 | -1299962421.9042821 |
NULL |
| -100 | 1 | 92 | 1 | 2024-02-16 04:37:37.00 | 23423423.0324234 |
NULL |
| -100 | 1 | 1 | 1 | 2024-02-16 04:37:37.00 | -1299962421.9042821 |
doris |
+------+------+------+------+------------------------+---------------------+-------+
4 rows in set (0.023 sec)
https://github.com/apache/doris/pull/33493 By supporting variant type
aggregation, this issue has been resolved.So versions after 2.1 do not have
this issue.
--
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]