Error expr: avg(ifnull( a const value, boolean value)). In removing avg and ifnull, we need add explicit cast.

This commit is contained in:
qingzhu521
2024-02-18 09:18:04 +00:00
committed by ob-robot
parent df515b0fa3
commit 0b94b8a434
3 changed files with 13 additions and 11 deletions

View File

@ -27,8 +27,8 @@ Query Plan
=================================================
Outputs & filters:
-------------------------------------
0 - output([INTERNAL_FUNCTION(t1.c1, 1, t2.c1, 1)]), filter(nil), rowset=16
1 - output([INTERNAL_FUNCTION(t1.c1, 1, t2.c1, 1)]), filter(nil), rowset=16
0 - output([INTERNAL_FUNCTION(t1.c1, 1, t2.c1, cast(1, BIGINT(20, 0)))]), filter(nil), rowset=16
1 - output([INTERNAL_FUNCTION(t1.c1, 1, t2.c1, cast(1, BIGINT(20, 0)))]), filter(nil), rowset=16
dop=3
2 - output([t1.c1], [t2.c1]), filter(nil), rowset=16
equal_conds([t1.c1 = t2.c1]), other_conds(nil)

View File

@ -160,10 +160,12 @@ Query Plan
=============================================================================
Outputs & filters:
-------------------------------------
0 - output([INTERNAL_FUNCTION(VIEW2.teacher.name, VIEW2.teacher.subject, cast(cast(cast(VIEW1.T_FUN_SUM(score.score) * cast(VIEW2.T_FUN_COUNT(*), DECIMAL_INT(20,
0)), DECIMAL_INT(33, 0)), DECIMAL(33, 0)) / cast(VIEW1.T_FUN_COUNT(score.score) * VIEW2.T_FUN_COUNT(*), DECIMAL(20, 0)), DECIMAL(15, 4)))]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(VIEW2.teacher.name, VIEW2.teacher.subject, cast(cast(cast(VIEW1.T_FUN_SUM(score.score) * cast(VIEW2.T_FUN_COUNT(*), DECIMAL_INT(20,
0)), DECIMAL_INT(33, 0)), DECIMAL(33, 0)) / cast(VIEW1.T_FUN_COUNT(score.score) * VIEW2.T_FUN_COUNT(*), DECIMAL(20, 0)), DECIMAL(15, 4)))]), filter(nil), rowset=256
0 - output([INTERNAL_FUNCTION(VIEW2.teacher.name, VIEW2.teacher.subject, cast(cast(cast(cast(VIEW1.T_FUN_SUM(score.score) * cast(VIEW2.T_FUN_COUNT(*),
DECIMAL_INT(20, 0)), DECIMAL_INT(75, 0)), DECIMAL_INT(33, 0)), DECIMAL(33, 0)) / cast(cast(VIEW1.T_FUN_COUNT(score.score) * VIEW2.T_FUN_COUNT(*), BIGINT(20,
0)), DECIMAL(20, 0)), DECIMAL(15, 4)))]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(VIEW2.teacher.name, VIEW2.teacher.subject, cast(cast(cast(cast(VIEW1.T_FUN_SUM(score.score) * cast(VIEW2.T_FUN_COUNT(*),
DECIMAL_INT(20, 0)), DECIMAL_INT(75, 0)), DECIMAL_INT(33, 0)), DECIMAL(33, 0)) / cast(cast(VIEW1.T_FUN_COUNT(score.score) * VIEW2.T_FUN_COUNT(*), BIGINT(20,
0)), DECIMAL(20, 0)), DECIMAL(15, 4)))]), filter(nil), rowset=256
dop=2
2 - output([VIEW2.T_FUN_COUNT(*)], [VIEW2.teacher.subject], [VIEW1.T_FUN_SUM(score.score)], [VIEW1.T_FUN_COUNT(score.score)], [VIEW2.teacher.name]), filter(nil), rowset=256
equal_conds([VIEW2.teacher.subject = VIEW1.score.subject]), other_conds(nil)