You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Force a conversion to BigInteger and rewrite the Sum and Product operations to act on Numbers and to return the correct type.
I don't think the second option is great, but I'd be a bit worried about causing issues in applications by throwing exceptions every time there is an overflow error - something which could easily happen when calculating products of Integers?
n3101
changed the title
Should the Sum and Product BinaryOperators check for number overflows?
The Sum and Product BinaryOperators should prevent number overflows
Aug 30, 2022
In a discussion offline @d21211122 said:
"Basically, there's a balance to be struck. We have to choose the least worst option... currently, we would have a failed aggregator (which isn't very nice when it's being run as part of an accumulo iterator.. i'm not quite sure how it would deal with it, but at the very least, I don't see how we'd ever get the affected records back out of the table, and at the very worse, I think it would screw up the whole compaction).
I'm not sure I like either of (the options above). Changing the data type might screw with anything that relies on the schema.
We could implement a simple 'fix', which would set the value to the MAX value if it goes above it, and it remains at MAX forever. It won't fail, but it will give incorrect data back and there won't be any indication that that is the case. We could log it, but the user won't see it."
Given the potential severity of the failure outlined above, we should consider d21211122's fix. Capping the value should be logged, so that at least there is a record of the event somewhere.
Before computing integer1+integer2 we should check that the maximum will not be more than Integer.MAX_VALUE.
See below for suggested solution.
The text was updated successfully, but these errors were encountered: