Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-11430

DataFrame's except method does not work, returns 0

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.5.0
    • Fix Version/s: None
    • Component/s: SQL
    • Labels:
      None

      Description

      This may or may not be related to this bug here: https://issues.apache.org/jira/browse/SPARK-11427

      But basically, the except method in dataframes should mirror the functionality of the subtract method in RDDs, but it is not doing so.

      Here is an example:
      scala> val firstFile = sqlContext.read.parquet("/Users/ramkandasamy/sparkData/2015-07-25/*").select("id").distinct
      firstFile: org.apache.spark.sql.DataFrame = [id: string]

      scala> val secondFile = sqlContext.read.parquet("/Users/ramkandasamy/sparkData/2015-10-23/*").select("id").distinct
      secondFile: org.apache.spark.sql.DataFrame = [id: string]

      scala> firstFile.count
      res1: Long = 1072046

      scala> secondFile.count
      res2: Long = 3569941

      scala> firstFile.except(secondFile).count
      res3: Long = 0

      scala> firstFile.rdd.subtract(secondFile.rdd).count
      res4: Long = 1072046

      Can anyone help out here? Thanks!

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ramk256 Ram Kandasamy
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: