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

Median_avg and quantile_avg ignore NULL values #6807

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed

Median_avg and quantile_avg ignore NULL values #6807

monetdb-team opened this issue Nov 30, 2020 · 0 comments
Labels
bug Something isn't working minor SQL

Comments

@monetdb-team
Copy link

Date: 2020-01-10 09:07:03 +0100
From: @PedroTadim
To: SQL devs <>
Version: 11.35.9 (Nov2019-SP1)

Last updated: 2020-02-21 12:36:58 +0100

Comment 27508

Date: 2020-01-10 09:07:03 +0100
From: @PedroTadim

User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36
Build Identifier:

If median_avg or the quantile_avg of a group is going to be computed as the average of two values, if one of them is NULL, then the value is ignored, while it shouldn't.

Reproducible: Always

Steps to Reproduce:

  1. SELECT median_avg(c1) FROM (VALUES (1), (NULL)) t1(c1);

Actual Results:

-128

Expected Results:

NULL

Comment 27509

Date: 2020-01-10 09:50:00 +0100
From: MonetDB Mercurial Repository <>

Changeset 14395b0ea40e made by Pedro Ferreira pedro.ferreira@monetdbsolutions.com in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=14395b0ea40e

Changeset description:

Added test and fix for bug #6807, ie look for NULL values while computing quantile_avg

Comment 27510

Date: 2020-01-10 11:33:12 +0100
From: @sjoerdmullender

Is this the correct thing to do?
Shouldn't NULL be ignored when calculating the median/quantile?
This would mean that the result is only NULL if all values are NULL, not if any is NULL.

@monetdb-team monetdb-team added bug Something isn't working minor SQL 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 minor SQL
Projects
None yet
Development

No branches or pull requests

2 participants