Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AVG( column ) returns NaN rather than Inf when column contains Inf #3922

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed
Labels
bug Something isn't working GDK Kernel normal

Comments

@monetdb-team
Copy link

Date: 2016-02-12 02:22:35 +0100
From: Anthony Damico <>
To: GDK devs <>
Version: 11.21.13 (Jul2015-SP2)
CC: ajdamico, @hannesmuehleisen, @njnes

Last updated: 2016-03-25 09:58:57 +0100

Comment 21782

Date: 2016-02-12 02:22:35 +0100
From: Anthony Damico <>

User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0
Build Identifier:

should the second result be NaN or Inf?

the result of MAX( ) appears to work

if the column contains both -Inf and also Inf, then i believe the column should return NaN

Reproducible: Always

Steps to Reproduce:

library(MonetDBLite)
library(MonetDB.R)
con <- dbConnect( MonetDBLite() , tempdir() )
x <- mtcars
x[1,1] <- Inf
dbWriteTable( con , 'x' , x )

dbGetQuery( con , "SELECT MIN( mpg ) , AVG( mpg ) , MAX( mpg ) FROM x" )

Actual Results:

dbGetQuery( con , "SELECT MIN( mpg ) , AVG( mpg ) , MAX( mpg ) FROM x" )
L1 L2 L3
1 10.4 NaN Inf

Expected Results:

L2 = Inf, i think? but not sure if this is my R bias

thanks!

Comment 21833

Date: 2016-02-26 16:03:14 +0100
From: @sjoerdmullender

This is an instance of a bigger problem: SQL doesn't allow for Inf (+ or -) or NaN. And hence, MonetDB doesn't allow for those values either. The R interface is now a backdoor through which those values can be introduced to the MonetDB internals, which are not prepared to handle them. In other words, garbage in, garbage out.

Comment 21835

Date: 2016-02-26 17:00:15 +0100
From: MonetDB Mercurial Repository <>

Changeset c3894dbe6e00 made by Hannes Muehleisen hannes@cwi.nl in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=c3894dbe6e00

Changeset description:

Bug #3922, do not import NaN or Inf

Comment 21952

Date: 2016-03-25 09:58:57 +0100
From: @sjoerdmullender

Jul2015-SP3 has been released.

@monetdb-team monetdb-team added bug Something isn't working GDK Kernel normal labels Nov 30, 2020
@sjoerdmullender sjoerdmullender added this to the Ancient Release milestone Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working GDK Kernel normal
Projects
None yet
Development

No branches or pull requests

2 participants