You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "ueshin (via GitHub)" <gi...@apache.org> on 2023/03/31 22:45:07 UTC

[GitHub] [spark] ueshin opened a new pull request, #40627: [SPARK-42998][CONNECT][PYTHON] Fix DataFrame.collect with null struct

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

   ### What changes were proposed in this pull request?
   
   Fix `DataFrame.collect` with null struct.
   
   ### Why are the changes needed?
   
   There is a behavior difference when collecting `null` struct:
   
   In Spark Connect:
   
   ```py
   >>> df = spark.sql("values (1, struct('a' as x)), (2, struct(null as x)), (null, null) as t(a, b)")
   >>> df.printSchema()
   root
    |-- a: integer (nullable = true)
    |-- b: struct (nullable = true)
    |    |-- x: string (nullable = true)
   >>> df.show()
   +----+------+
   |   a|     b|
   +----+------+
   |   1|   {a}|
   |   2|{null}|
   |null|  null|
   +----+------+
   
   >>> df.collect()
   [Row(a=1, b=Row(x='a')), Row(a=2, b=Row(x=None)), Row(a=None, b=<Row()>)]
   ```
   
   whereas PySpark:
   
   ```py
   >>> df.collect()
   [Row(a=1, b=Row(x='a')), Row(a=2, b=Row(x=None)), Row(a=None, b=None)]
   ```
   
   ### Does this PR introduce _any_ user-facing change?
   
   The behavior fix.
   
   ### How was this patch tested?
   
   Added/modified the related tests.


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] zhengruifeng commented on pull request #40627: [SPARK-42998][CONNECT][PYTHON] Fix DataFrame.collect with null struct

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on PR #40627:
URL: https://github.com/apache/spark/pull/40627#issuecomment-1492778516

   Thanks, merged into master/branch-3.4


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] zhengruifeng closed pull request #40627: [SPARK-42998][CONNECT][PYTHON] Fix DataFrame.collect with null struct

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng closed pull request #40627: [SPARK-42998][CONNECT][PYTHON] Fix DataFrame.collect with null struct
URL: https://github.com/apache/spark/pull/40627


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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