-
Notifications
You must be signed in to change notification settings - Fork 102
Fix aggregate function on litteral #543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
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.0
or'1.0'
(even forAVG(1)) and not
1or
'1'` so I think we need to add the float result (and the stringified float result).