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

CreateMap allows non-unique keys

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Incomplete
    • 2.0.0
    • None
    • SQL

    Description

      Spark-Sql, CreateMap does not enforce unique keys, i.e. it's possible to create a map with two identical keys:

      CreateMap(Literal(1), Literal(11), Literal(1), Literal(12))
      

      This does not behave like standard maps in common programming languages.
      proper behavior should be chosen:

      1. first 'wins'
      2. last 'wins'
      3. runtime error.

      GetMapValue currently implements option #1. Even if this is the desired behavior CreateMap should return a unique map.

      Attachments

        Activity

          People

            Unassigned Unassigned
            eyalfa Eyal Farago
            Herman van Hövell Herman van Hövell
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: