Skip to content
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 type in decimal_avg and decimal_sum while spilling #414

Closed
wants to merge 2 commits into from
Closed

Fix type in decimal_avg and decimal_sum while spilling #414

wants to merge 2 commits into from

Conversation

mskapilks
Copy link

We have been playing around with spill in partial aggregate when we noticed velox crashes when it read data back from spill in partial aggregate. This happens when input type is of ShortDecimal like decimal(12,4).
Both these agg function produces intermediate sum of LongDecimal irrespective of input. So when input is of LongDecimal it works but in case of ShortDecimal this respective dynamic type cast fails producing null pointer causing crash.

@mskapilks
Copy link
Author

cc: @zhouyuan

@rui-mo
Copy link
Collaborator

rui-mo commented Oct 9, 2023

cc @liujiayi771

@liujiayi771
Copy link

liujiayi771 commented Oct 9, 2023

@rui-mo For sum agg, this probloem has been fixed in upstream PR. But for avg agg, I think the intermediate type will always be int128_t, as discussed in https://github.com/facebookincubator/velox/pull/6020/files#r1302694957, it seems that TSumResultType in this modification will always be int128_t.

@zhouyuan
Copy link
Collaborator

zhouyuan commented Oct 9, 2023

@mskapilks could you please help to review this patch? facebookincubator#6020

@rui-mo actually has a new branch based on meta/velox + several important backport patches (https://github.com/oap-project/velox/tree/update) which will become the new "main" branch soon.

thanks, -yuan

@mskapilks mskapilks closed this by deleting the head repository Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants