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 2016/04/28 00:02:12 UTC

[jira] [Updated] (SPARK-14967) EXCEPT does not follow SQL compliance

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

Xiao Li updated SPARK-14967:
----------------------------
    Description: 
{noformat}
  test("except") {
    val df_left = Seq(1, 2, 2, 3, 3, 4).toDF("id")
    val df_right = Seq(1, 3).toDF("id")

    checkAnswer(
      df_left.except(df_right),
      Row(2) :: Row(2) :: Row(4) :: Nil
    )
  }
{noformat}

This is the example.
For `EXCEPT ALL`, we should output
{noformat}
Row(2) :: Row(2) :: Row(3) :: Row(4) :: Nil
{noformat}
For `EXCEPT DISTINCT`, we should output
{noformat}
Row(2) :: Row(4) :: Nil
{noformat}

Thus, the current master is wrong. The result it generates is 
{noformat}
Row(2) :: Row(2) :: Row(4) :: Nil
{noformat}


  was:
{noformat}
  test("except") {
    val df_left = Seq(1, 2, 2, 3, 3, 4).toDF("id")
    val df_right = Seq(1, 3).toDF("id")

    checkAnswer(
      df_left.except(df_right),
      Row(2) :: Row(2) :: Row(4) :: Nil
    )
  }
{noformat}

This is the example.
For `EXCEPT ALL`, we should output
{noformat}
Row(2) :: Row(2) :: Row(3) :: Row(4) :: Nil
{noformat}
For `EXCEPT DISTINCT`, we should output
{noformat}
Row(2) :: Row(4) :: Nil
{noformat}

Thus, the current master is wrong. 


> EXCEPT does not follow SQL compliance
> -------------------------------------
>
>                 Key: SPARK-14967
>                 URL: https://issues.apache.org/jira/browse/SPARK-14967
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.0.0
>            Reporter: Xiao Li
>
> {noformat}
>   test("except") {
>     val df_left = Seq(1, 2, 2, 3, 3, 4).toDF("id")
>     val df_right = Seq(1, 3).toDF("id")
>     checkAnswer(
>       df_left.except(df_right),
>       Row(2) :: Row(2) :: Row(4) :: Nil
>     )
>   }
> {noformat}
> This is the example.
> For `EXCEPT ALL`, we should output
> {noformat}
> Row(2) :: Row(2) :: Row(3) :: Row(4) :: Nil
> {noformat}
> For `EXCEPT DISTINCT`, we should output
> {noformat}
> Row(2) :: Row(4) :: Nil
> {noformat}
> Thus, the current master is wrong. The result it generates is 
> {noformat}
> Row(2) :: Row(2) :: Row(4) :: Nil
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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