zhengruifeng commented on code in PR #39570:
URL: https://github.com/apache/spark/pull/39570#discussion_r1070246340


##########
python/pyspark/sql/connect/functions.py:
##########
@@ -192,6 +194,17 @@ def lit(col: Any) -> Column:
     if isinstance(col, Column):
         return col
     elif isinstance(col, list):
+        return array(*[lit(c) for c in col])
+    elif isinstance(col, np.ndarray) and col.ndim == 1:
+        if _from_numpy_type(col.dtype) is None:
+            raise TypeError("The type of array scalar '%s' is not supported" % 
(col.dtype))
+
+        # NumpyArrayConverter for Py4J can not support ndarray with int8 
values.

Review Comment:
   see 
https://github.com/apache/spark/blob/master/python/pyspark/sql/types.py#L2275-L2295



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