viirya commented on code in PR #5675:
URL: https://github.com/apache/arrow-datafusion/pull/5675#discussion_r1152900666


##########
benchmarks/queries/q8.sql:
##########
@@ -1,9 +1,9 @@
 select
     o_year,
-    sum(case
+    cast(cast(sum(case
             when nation = 'BRAZIL' then volume
             else 0
-        end) / sum(volume) as mkt_share
+        end) as decimal(12,2)) / cast(sum(volume) as decimal(12,2)) as 
decimal(15,2)) as mkt_share

Review Comment:
   With inner `cast`s wrapping two `sum`, we can use a result scale which won't 
cause overflow. The result decimal is correct.
   
   But the answer file is fixed as decimal(15, 2) so the result still fails the 
check. I only can add another `cast` to make it as same decimal type to pass 
this result check.



-- 
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]

Reply via email to