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

The UUID() expression is too non-deterministic

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.3.0
    • Fix Version/s: 2.3.1, 2.4.0
    • Component/s: SQL
    • Labels:
      None
    • Target Version/s:

      Description

      The current Uuid() expression uses java.util.UUID.randomUUID for UUID generation. There are a couple of major problems with this:

      • It is non-deterministic across task retries. This breaks Spark's processing model, and this will to very hard to trace bugs, like non-deterministic shuffles, duplicates and missing rows.
      • It uses a single secure random for UUID generation. This uses a single JVM wide lock, and this can lead to lock contention and other performance problems.

      We should move to something that is deterministic between retries. This can be done by using seeded PRNGs for which we set the seed during planning. It is important here to use a PRNG that provides enough entropy for creating a proper UUID.

        Attachments

          Activity

            People

            • Assignee:
              viirya Liang-Chi Hsieh
              Reporter:
              hvanhovell Herman van Hovell
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: