Hussain Towaileb has posted comments on this change. Change subject: [ASTERIXDB-2460][FUN] Fix sum() overflow bug ......................................................................
Patch Set 6: (1 comment) https://asterix-gerrit.ics.uci.edu/#/c/3012/6/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/AbstractSumAggregateFunction.java File asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/AbstractSumAggregateFunction.java: Line 55: private double sum; > Currently I'm only doing the sum in a local double instance but the output I just checked the standards and you're right, the appropriate behavior is to throw the overflow exception. I'll go ahead and use that implementation. However, I would suggest that we create another sum function (something like sum_double) to handle calculations where an overflow is expected and make it return a double by default, it will be more convenient for such situations (and maybe provide a better performance than sum(to_double(x))?) What do you think? -- To view, visit https://asterix-gerrit.ics.uci.edu/3012 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: comment Gerrit-Change-Id: I987417770b3bfbda6af29a27acc8c96dc8a99eb8 Gerrit-PatchSet: 6 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Hussain Towaileb <[email protected]> Gerrit-Reviewer: Ali Alsuliman <[email protected]> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Dmitry Lychagin <[email protected]> Gerrit-Reviewer: Hussain Towaileb <[email protected]> Gerrit-Reviewer: James Fang <[email protected]> Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-HasComments: Yes
