Ruifeng Zheng created SPARK-61541:
-------------------------------------
Summary: Fast-path exact primitive values in Column methods
Key: SPARK-61541
URL: https://issues.apache.org/jira/browse/SPARK-61541
Project: Spark
Issue Type: Improvement
Components: Connect
Affects Versions: connect-rust-4.3.0
Reporter: Ruifeng Zheng
The primitive fast paths added for literal conversion do not avoid the Enum and
NumPy probes in to_value_column(). Column.isin() repeats these probes for every
candidate value; getItem(), indexing, chained Column.when(), and otherwise()
also use this entry point.
Share the existing exact-builtin literal converter between to_column() and
to_value_column(), and call it before the probes. Preserve the generic
conversion order for subclasses, Enum values, out-of-range integers, lists,
NumPy values, and other non-primitive inputs.
A release-build microbenchmark on CPython 3.13 measured 6.04x faster
construction for isin() with 1,000 integers, 4.47x for 1,000 strings, and
1.68-2.20x for individual value methods. These timings measure local expression
construction, not Spark execution. Add regression coverage for primitive wire
encoding and the retained fallback paths.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]