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

DataFrame's intersect method does not work, returns 1

    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

      Hello,

      I was working with dataframes and I found the intersect() method seems to always return '1'. The RDD's intersection() method does work properly.

      Consider this 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> firstFile.count
      res4: Long = 1072046

      scala> firstFile.intersect(firstFile).count
      res5: Long = 1

      scala> firstFile.rdd.intersection(firstFile.rdd).count
      res6: Long = 1072046

      I have tried various different cases, and for some reason, the dataframe's intersect method always returns 1.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: