asolimando commented on PR #20865:
URL: https://github.com/apache/datafusion/pull/20865#issuecomment-4067486933

   Thanks for working on this @kumarUjjawal, but I have a few suggestions:
   
   1. The original idea in #20826 was to change the `sum_value` field type to 
always store a wide type, making overflow protection structural. The 
lazy-widening approach here requires every future call site to remember to use 
`add_for_sum`/`cast_to_sum_type` instead of `add`/`multiply`, with no compiler 
enforcement. At minimum, a doc comment on `sum_value` warning about this would 
help.
   
   This forces to change all consumers, but it would prove more robust over 
time.
   
   2. The `Exact`/`Inexact` arms in `cast_to_sum_type` are nearly identical and 
could be collapsed I think


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to