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

PySpark SQL rand function treats seed 0 as no seed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4.0, 1.4.1, 1.4.2, 1.5.0
    • 1.4.2, 1.5.0
    • PySpark, SQL
    • None
    • Spark 1.5 release

    Description

      In PySpark SQL's rand() function, it tests for a seed in a way such that seed 0 is treated as no seed, leading to non-deterministic results when a user would expect deterministic results.

      See: https://github.com/apache/spark/blob/98e69467d4fda2c26a951409b5b7c6f1e9345ce4/python/pyspark/sql/functions.py#L271

      Attachments

        Issue Links

          Activity

            People

              yhuai Yin Huai
              josephkb Joseph K. Bradley
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: