You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/05/15 11:17:32 UTC

[GitHub] [spark] viirya opened a new pull request #24614: [SPARK-27712][PySpark][SQL] Returns correct schema even under different column order when creating dataframe

viirya opened a new pull request #24614: [SPARK-27712][PySpark][SQL] Returns correct schema even under different column order when creating dataframe
URL: https://github.com/apache/spark/pull/24614
 
 
   ## What changes were proposed in this pull request?
   
   In PySpark, `Row`'s `__from_dict__` is lost after pickle. But we rely on `__from_dict__` when converting `Row`s to internal by calling `toInternal`. It causes a weird behavior:
   
   ```python
   >>> spark.createDataFrame([Row(A="1", B="2")], "B string, A string").first()
   Row(B='2', A='1') # correct
   >>> spark.createDataFrame(spark.sparkContext.parallelize([Row(A="1", B="2")]), "B string, A string").first()
   Row(B='1', A='2') # incorrect                                                         
   ```
   
   This patch tried to fix the issue.
   
   ## How was this patch tested?
   
   Added test.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org