IFNULL返回结果不合预期

Viewed 30

doris version:2.1.7

sql1:
mysql> desc table_hashh;
+-------+---------+------+-------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------+------+-------+---------+-------+
| k1 | tinyint | Yes | true | NULL | |
| k2 | float | Yes | false | NULL | NONE |
+-------+---------+------+-------+---------+-------+

sql2:
mysql> select * from table_hashh order by k1;
+------+------+
| k1 | k2 |
+------+------+
| 1 | 1 |
| 2 | NULL |
| 3 | NULL |
+------+------+

sql3:
mysql> select k1, ifnull(k2, 10) from table_hashh order by k1;
+------+-------------------------------+
| k1 | ifnull(k2, cast(10 as FLOAT)) |
+------+-------------------------------+
| 1 | 1 |
| 2 | NULL |
| 3 | 10 |
+------+-------------------------------+

预想sql3中k2的NULL应该转换为10

补充插入数据:
image.png
image.png

1 Answers

本地测试是正常的:image.png

是否有数据差异?