You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Xiao Li (JIRA)" <ji...@apache.org> on 2017/05/05 06:29:04 UTC

[jira] [Closed] (SPARK-20545) union set operator should default to DISTINCT and not ALL semantics

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

Xiao Li closed SPARK-20545.
---------------------------
    Resolution: Cannot Reproduce

> union set operator should default to DISTINCT and not ALL semantics
> -------------------------------------------------------------------
>
>                 Key: SPARK-20545
>                 URL: https://issues.apache.org/jira/browse/SPARK-20545
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.1.0
>            Reporter: N Campbell
>
> A set operation (i.e union) over two queries that produce identical row values should return the distinct set of rows and not all rows.
> ISO-SQL set operation semantics default to DISTINCT 
> SPARK implementation is defaulting to ALL
> While SPARK allows DISTINCT keyword and some might assume ALL is faster, the wrong result set semantically is produced per standard (and commercial SQL systems including: ORACLE, DB2, Teradata, SQL Server etc.)
> select tsint.csint from cert.tsint 
> union 
> select tint.cint from cert.tint 
> csint
> <null>
> -1
> 0
> 1
> 10
> <null>
> -1
> 0
> 1
> 10
> vs
> select tsint.csint from cert.tsint union distinct select tint.cint from cert.tint 
> csint
> -1
> <null>
> 1
> 10
> 0



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org