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

Default options for metadata & nullable when creating StructType

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: In Progress
    • Minor
    • Resolution: Unresolved
    • 3.0.1
    • None
    • PySpark
    • Patch

    Description

      When create a StructType from a Python dictionary you utilize the StructType.fromJson function. This function then internally calls StructField.fromJson for each field in the list. This function requires that you must have all keys populated:

      • name
      • type
      • nullable
      • metadata

       

      name and type most definitely have to be required. However, if you take a look at the constructor for StructField there are default arguments for nullable and metadata. This is turn makes me think that these fields should be optional when creating a StructType from a Python dict.

      Attachments

        Activity

          People

            apachespark Apache Spark
            jawnroof Jack Roof
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 96h
                96h
                Remaining:
                Remaining Estimate - 96h
                96h
                Logged:
                Time Spent - Not Specified
                Not Specified