HyukjinKwon commented on code in PR #37722:
URL: https://github.com/apache/spark/pull/37722#discussion_r958291678
##########
python/pyspark/sql/functions.py:
##########
@@ -149,7 +152,17 @@ def lit(col: Any) -> Column:
+------+---+
| 5| 0|
+------+---+
+
+ Create a literal from a list.
+
+ >>> spark.range(1).select(F.lit([1, 2, 3])).show()
+ +--------------+
+ |array(1, 2, 3)|
+ +--------------+
+ | [1, 2, 3]|
+ +--------------+
"""
+ col = array(*[lit(item) for item in col]) if isinstance(col, list) else col
Review Comment:
Actually we should probably block the case of `[Column, Column]` because
Scala side does not allow that case.
--
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]