Hyukjin Kwon created SPARK-61523:
------------------------------------
Summary: Send a NumPy NaT in a day-time interval field of
createDataFrame as null, and check for a NumPy array only after a list and a
tuple, in the Python client as PySpark does
Key: SPARK-61523
URL: https://issues.apache.org/jira/browse/SPARK-61523
Project: Spark
Issue Type: Bug
Components: Connect
Affects Versions: connect-rust-4.3.0
Reporter: Hyukjin Kwon
Follow-ups of a post-hoc review of the SPARK-61483 follow-up #546, checked
against PySpark 4.3.0, which passes the values of these fields to PyArrow as
they are:
- A NumPy NaT (np.timedelta64('NaT', 'us')) in a day-time interval field of
local rows was sent as -9223372036854775808 microseconds, which collects as
timedelta(days=-106751992, ...). This held for a scalar, an element of a NumPy
array in an array field, and a value in a struct or a map. PyArrow, and so
PySpark, makes it null. The defect predates #546 (it has been there since
SPARK-61106), and #546's array path reaches it too.
- #546 made the conversion of every array value check for a NumPy array first,
importing sys each time. createDataFrame of 100,000 rows of ([1, 2, 3],) in an
array<int> field took 75 ms, where the converter path takes 37 ms.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]