-
- Downloads
[SPARK-16700][PYSPARK][SQL] create DataFrame from dict/Row with schema
## 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.
Showing
- python/pyspark/sql/context.py 6 additions, 2 deletionspython/pyspark/sql/context.py
- python/pyspark/sql/session.py 13 additions, 16 deletionspython/pyspark/sql/session.py
- python/pyspark/sql/tests.py 16 additions, 0 deletionspython/pyspark/sql/tests.py
- python/pyspark/sql/types.py 27 additions, 10 deletionspython/pyspark/sql/types.py
Loading
Please register or sign in to comment