Fix aggregate function on litteral#543
Conversation
a024209 to
705981b
Compare
705981b to
da099d4
Compare
da099d4 to
42c4b04
Compare
|
Seems like doesn't do what I was looking for @ondrejmirtes, I may require your help to end this PR. If I have a ConstantInteger(1), I can get a ConstantFloat(1.0) with the |
|
I'm using generalize for those cases (expand QueryResultTypeWalker) |
bf700d5 to
e8900d4
Compare
e8900d4 to
9c3f7ae
Compare
I used But if we're doing |
|
For AVG, it is edgecase, but the same issue for SUM is not. |
|
Thank you. |
|
Your welcome Since 1.3.x is not the base branch it didn't closed automatically the issue #460 @ondrejmirtes |
Closes #460
Since you introduced this in #232, I'll be happy to have your review @arnaud-lb
When doing a SUM, I think the type must be "ungeneralize" (cf #460 )
When doing a AVG,
$type = TypeCombinator::union($type, $type->toFloat(), $type->toFloat()->toString());because the AVG value computed in my tests was1.0or'1.0'(even forAVG(1)) and not1or'1'` so I think we need to add the float result (and the stringified float result).