You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "ThomasAWalker (via GitHub)" <gi...@apache.org> on 2024/11/14 16:13:59 UTC

[I] Max of NaN returns minimum value when GROUP BY is used [datafusion]

ThomasAWalker opened a new issue, #13415:
URL: https://github.com/apache/datafusion/issues/13415

   ### Describe the bug
   
   When group by is used with MAX and a group contains only NaNs the result is the minimum floating point value.
   Similarly MIN returns the maximum floating point value.
   
   ### To Reproduce
   
   ```
   CREATE TABLE input_table (
       "row" integer,
       "x" double precision    
   );
   
   INSERT INTO input_table VALUES    (1, 'NaN');
   
   SELECT max(input_table.x), min(input_table.x) from input_table GROUP BY input_table."row";
   ```
   
   ### Expected behavior
   
   In sqlite, postgres and duck both min and max will return NaN
   
   ### Additional context
   
   _No response_


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


Re: [I] Max of NaN returns f64::MIN when GROUP BY is used [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #13415: Max of NaN returns f64::MIN when GROUP BY is used
URL: https://github.com/apache/datafusion/issues/13415


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