You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "kosiew (via GitHub)" <gi...@apache.org> on 2026/08/27 10:12:20 UTC

Re: [PR] fix: Address avg return type overflow for decimals [datafusion]

kosiew commented on code in PR #24371:
URL: https://github.com/apache/datafusion/pull/24371#discussion_r3870762535


##########
datafusion/sqllogictest/test_files/decimal.slt:
##########
@@ -1339,4 +1339,16 @@ from (
     from generate_series(1, 65536) t(v)
 ) t;
 ----
-32768.5 Decimal32(9, 4) 32768.5
+32768.5 Decimal64(13, 4) 32768.5
+
+# TPC-DS `store_returns.sr_return_amt` is Decimal32(7, 2). Its average needs

Review Comment:
   Could we add a small `GROUP BY` SQLLogicTest using `Decimal32(7, 2)` and assert that the result type is `Decimal64(11, 6)`? The unit tests already exercise the grouped state conversion, but an end-to-end grouped query would also verify that the planner selects the groups accumulator and that it produces the widened Arrow output type.



-- 
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-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org