pitrou commented on PR #44184: URL: https://github.com/apache/arrow/pull/44184#issuecomment-2869958414
> As for the mean and product, there's a few actions we could take: > * Status quo: Input type is the same as output type > * Promote both to maximum precision > * Promote only _product_ to max precision: `abs(mean) <= max(abs(max), abs(min))` so not really _necessary_ for mean > * Promote only _product_ to a double: this is what, e.g., duckdb does "Promoting" to double is a demotion: it loses a lot of potential precision. The mean should certainly stay the same as the input type (and care should be taken to avoid overflows during intermediate computations, if at all possible). As for the product, it would also be better to not lose too much precision, and therefore stay in the decimal domain. But it sounds less common to compute the product of a bunch of decimals, anyway. -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org