HyukjinKwon opened a new pull request, #39344:
URL: https://github.com/apache/spark/pull/39344

   ### What changes were proposed in this pull request?
   
   This PR proposes to support to infer field names when the input data is the 
list of dictionaries in `SparkSession.createDataFrame`.
   
   For example,
   
   ```
   spark.createDataFrame([{"course": "dotNET", "earnings": 10000, "year": 
2012}]).show()
   ```
   
   **Before**:
   
   ```python
   +------+-----+----+
   |    _1|   _2|  _3|
   +------+-----+----+
   |dotNET|10000|2012|
   +------+-----+----+
   ```
   
   **After**:
   
   ```python
   +------+--------+----+
   |course|earnings|year|
   +------+--------+----+
   |dotNET|   10000|2012|
   +------+--------+----+
   ```
   
   ### Why are the changes needed?
   
   To match the behaviour with the regular PySpark.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No to end users because Spark Connect has not been released.
   
   ### How was this patch tested?
   
   Unittest was added.


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to