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

Extend functionality of from_json to support arrays of differently-typed elements

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • 2.3.1
    • None
    • PySpark, Spark Core
    • None

    Description

      At the moment, the 'from_json' function only supports a STRUCT or an ARRAY of STRUCTS as input. Support for ARRAY of primitives is, apparently, coming with Spark 2.4, but it will only support arrays of elements of same data type. It will not, for example, support JSON-arrays like

      ["string_value", 0, true, null]
      

      which is JSON-valid with schema

      {"containsNull":true,"elementType":["string","integer","boolean"],"type":"array"}
      

      We would like to kindly ask you to add support for different-typed element arrays in the 'from_json' function. This will necessitate extending the functionality of ArrayType or maybe adding a new type (refer to [SPARK-25225])

      Attachments

        Activity

          People

            Unassigned Unassigned
            davygora Yuriy Davygora
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: