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

Default options for metadata & nullable when creating StructType

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: In Progress
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.0.1
    • Fix Version/s: None
    • Component/s: PySpark
    • Flags:
      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

            • Assignee:
              apachespark Apache Spark
              Reporter:
              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