Hyukjin Kwon created SPARK-62310:
------------------------------------
Summary: Make StructField.needConversion of the drop-in as fast as
PySpark's, so that StructType.add and the StructType constructor are
Key: SPARK-62310
URL: https://issues.apache.org/jira/browse/SPARK-62310
Project: Spark
Issue Type: Improvement
Components: Connect
Affects Versions: 5.0.0
Reporter: Hyukjin Kwon
On master f71ddd17 against PySpark 4.3.0, StructField.needConversion of the
Python client takes 887 ns against 61 ns, so 2,000 StructType.add calls with
metadata (PySpark's own quadratic algorithm, [f.needConversion() for f in self]
at each add) take 1,583 ms against 127 ms, and StructType of 2,000 fields takes
1.61 ms against 0.21 ms. The needConversion of a field reaches its type through
the generic need_conversion_of_object -> is_udt + py_to_data_type path rather
than the type's own method (51 ns). Make it as fast as PySpark's, keeping
PySpark's semantics for subclasses, values that are not types and UDTs.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]