Skip to content
Snippets Groups Projects
  • Davies Liu's avatar
    fffb0c0d
    [SPARK-16700][PYSPARK][SQL] create DataFrame from dict/Row with schema · fffb0c0d
    Davies Liu authored
    ## What changes were proposed in this pull request?
    
    In 2.0, we verify the data type against schema for every row for safety, but with performance cost, this PR make it optional.
    
    When we verify the data type for StructType, it does not support all the types we support in infer schema (for example, dict), this PR fix that to make them consistent.
    
    For Row object which is created using named arguments, the order of fields are sorted by name, they may be not different than the order in provided schema, this PR fix that by ignore the order of fields in this case.
    
    ## How was this patch tested?
    
    Created regression tests for them.
    
    Author: Davies Liu <davies@databricks.com>
    
    Closes #14469 from davies/py_dict.
    fffb0c0d
    History
    [SPARK-16700][PYSPARK][SQL] create DataFrame from dict/Row with schema
    Davies Liu authored
    ## What changes were proposed in this pull request?
    
    In 2.0, we verify the data type against schema for every row for safety, but with performance cost, this PR make it optional.
    
    When we verify the data type for StructType, it does not support all the types we support in infer schema (for example, dict), this PR fix that to make them consistent.
    
    For Row object which is created using named arguments, the order of fields are sorted by name, they may be not different than the order in provided schema, this PR fix that by ignore the order of fields in this case.
    
    ## How was this patch tested?
    
    Created regression tests for them.
    
    Author: Davies Liu <davies@databricks.com>
    
    Closes #14469 from davies/py_dict.