Skip to content

SQL: COUNT DISTINCT returns 0 instead of NULL for no matching docs#50037

Merged
astefan merged 2 commits intoelastic:masterfrom
astefan:50013_fix
Dec 11, 2019
Merged

SQL: COUNT DISTINCT returns 0 instead of NULL for no matching docs#50037
astefan merged 2 commits intoelastic:masterfrom
astefan:50013_fix

Conversation

@astefan
Copy link
Copy Markdown
Contributor

@astefan astefan commented Dec 10, 2019

This PR reverts a small change that silently introduced a change in behavior for COUNT DISTINCT that made it return NULL for a query that was not matching any documents, instead of 0.

Fixes #50013.

@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-search (:Search/SQL)

Copy link
Copy Markdown
Member

@costin costin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Contributor

@matriv matriv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@astefan astefan merged commit cb94731 into elastic:master Dec 11, 2019
@astefan astefan deleted the 50013_fix branch December 11, 2019 21:53
astefan added a commit that referenced this pull request Dec 11, 2019
astefan added a commit that referenced this pull request Dec 12, 2019
astefan added a commit that referenced this pull request Dec 12, 2019
SivagurunathanV pushed a commit to SivagurunathanV/elasticsearch that referenced this pull request Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

COUNT DISTINCT for 0 matching documents return NULL

5 participants