[ 
https://issues.apache.org/jira/browse/SPARK-49000?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Uroš Bojanić updated SPARK-49000:
---------------------------------
    Description: 
Aggregation with *DISTINCT* gives wrong results when dealing with literals.

 

For example:
{code:java}
select count(distinct 1) from t{code}
returns 1, while the correct result should be 0.

 

For reference:
{code:java}
select count(1) from t{code}
returns 0, which is the correct and expected result.

 

In these examples, suppose that *t* is a table with any columns).

  was:
Aggregation with *DISTINCT* gives wrong results when dealing with literals.

 

For example:
{code:java}
select count(distinct 1) from t{code}
returns 1, while the correct result should be 0.

For reference:
{code:java}
select count(1) from t{code}
returns 0, which is the correct and expected result.

 

In these examples, suppose that *t* is a table with any columns).


> Aggregation with DISTINCT gives wrong results when dealing with literals
> ------------------------------------------------------------------------
>
>                 Key: SPARK-49000
>                 URL: https://issues.apache.org/jira/browse/SPARK-49000
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.0.0
>            Reporter: Uroš Bojanić
>            Priority: Critical
>
> Aggregation with *DISTINCT* gives wrong results when dealing with literals.
>  
> For example:
> {code:java}
> select count(distinct 1) from t{code}
> returns 1, while the correct result should be 0.
>  
> For reference:
> {code:java}
> select count(1) from t{code}
> returns 0, which is the correct and expected result.
>  
> In these examples, suppose that *t* is a table with any columns).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to