viirya commented on issue #10688:
URL: https://github.com/apache/datafusion/issues/10688#issuecomment-2136086622

   When `-128.2::float` is treated as float64, there is some precision 
difference.
   
   ```
   > explain select avg(a) from (select -128.2::float a union all select 
32768.3 union all select 27.3);
   +---------------+--------------------------------------------------------+
   | plan_type     | plan                                                   |
   +---------------+--------------------------------------------------------+
   | logical_plan  | Aggregate: groupBy=[[]], aggr=[[AVG(a)]]               |
   |               |   Union                                                |
   |               |     Projection: Float64(-128.1999969482422) AS a       |
   |               |       EmptyRelation                                    |
   |               |     Projection: Float64(32768.3) AS a                  |
   |               |       EmptyRelation                                    |
   |               |     Projection: Float64(27.3) AS a                     |
   |               |       EmptyRelation                                    |
   | physical_plan | AggregateExec: mode=Final, gby=[], aggr=[AVG(a)]       |
   |               |   CoalescePartitionsExec                               |
   |               |     AggregateExec: mode=Partial, gby=[], aggr=[AVG(a)] |
   |               |       UnionExec                                        |
   |               |         ProjectionExec: expr=[-128.1999969482422 as a] |
   |               |           PlaceholderRowExec                           |
   |               |         ProjectionExec: expr=[32768.3 as a]            |
   |               |           PlaceholderRowExec                           |
   |               |         ProjectionExec: expr=[27.3 as a]               |
   |               |           PlaceholderRowExec                           |
   |               |                                                        |
   +---------------+--------------------------------------------------------+
   ```


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

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


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

Reply via email to