Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-6116 DataFrame API improvement umbrella ticket (Spark 1.5)
  3. SPARK-7982

crosstab should use 0 instead of null for pairs that don't appear

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.4.0
    • SQL
    • Spark 1.5 doc/QA sprint

    Description

      See the following

      In [79]: sqlContext.range(0, 10).stat.crosstab('id', 'id').show()
      +-----+----+----+----+----+----+----+----+----+----+----+
      |id_id|   0|   5|   1|   6|   9|   2|   7|   3|   8|   4|
      +-----+----+----+----+----+----+----+----+----+----+----+
      |    0|   1|null|null|null|null|null|null|null|null|null|
      |    5|null|null|null|null|null|   1|null|null|null|null|
      |    1|null|   1|null|null|null|null|null|null|null|null|
      |    6|null|null|null|null|null|null|   1|null|null|null|
      |    9|null|null|null|null|null|null|null|null|null|   1|
      |    2|null|null|   1|null|null|null|null|null|null|null|
      |    7|null|null|null|null|null|null|null|   1|null|null|
      |    3|null|null|null|   1|null|null|null|null|null|null|
      |    8|null|null|null|null|null|null|null|null|   1|null|
      |    4|null|null|null|null|   1|null|null|null|null|null|
      +-----+----+----+----+----+----+----+----+----+----+----+
      

      I think we should use 0 instead of null for these columns.

      Attachments

        Activity

          People

            rxin Reynold Xin
            rxin Reynold Xin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: