Repository navigation
Conversation
The earlier sentence already says that customized inputs keep the row conversion path; the guards' internals are described in dev/design/architecture.md. Co-authored-by: Isaac <no-reply@databricks.com>
HyukjinKwon
marked this pull request as ready for review
November 8, 2026 10:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
SPARK-60745: preserve native row-conversion behavior for customized Arrow-backed pandas strings in the columnar input path already on master.
Specialized, generic explicit-schema and inferred/names-only routes share the relevant hook and alias eligibility checks. Covered custom array/label conversion hooks and rebound schema-converter aliases decline to native rows, so another admission route cannot bypass those rejections. The specialized string helper separately declines recognized storage-normalization and validation failures, including a column storage length that differs from the frame. Ordinary supported inputs retain the existing columnar paths and size/schema thresholds.
Inspect current instance hooks and selected canonical class attributes, including inherited methods and pandas' NumPy-semantics mixin/partial dispatch. Read raw class attributes without binding customized descriptors, and recheck between columns because an accessor can change a hook. Only the pandas helper, regression tests and architecture documentation change.
Why are the changes needed?
Direct Arrow-storage extraction can bypass a customized conversion method, change values, suppress an exception or run label callbacks earlier than native row conversion. The covered fixtures must retain native values, errors and ordering through every applicable admission route.
Does this PR introduce any user-facing change?
Yes. Inputs with the covered customizations fall back to native rows; ordinary eligible inputs retain the existing fast path. Authentication adds per-column work, and conservative fallback can cost more than columnar conversion.
The guarantee is bounded to the selected canonical Arrow-string classes, instance/class hooks and explicitly checked aliases. Class data read by those methods, including
_storageand_na_value, and other module globals are outside the checks. Other array classes retain the existing generic-route module-origin policy. Arbitrary private storage replacement or inconsistent frame internals are not covered by an all-route consistency guarantee. This does not establish an invariant for arbitrary pandas mutations or full Python behavioral parity. A guard can already have readframe.dtypesbefore inspecting the array; it is not a promise that pandas callbacks never run.Existing importer costs remain: configuration RPCs, validation/casting, alignment, IPC serialization and threshold-triggered artifact uploads. Narrowing
large_stringto Arrowstringcan copy the offset buffer; this path is not universally zero-copy. Simulated cast failures do not establish support for actual storage above 2 GiB or malformed offsets. The inherited package/runtime pandas-minimum mismatch and support for older/broken dependencies are not repaired here.How was this patch tested?
Candidate
33559dc2af3df57b4db56b1cb90f16d1f5bbd8c5against baselinee8b1d4284e11d119c4fda9563a913ece22f43e7c:InMemoryCatalog. A final 48-input transport/build/harness equality audit supports carrying this result to Arrow. Arrow's binary did not execute this official suite; it used the Decimal binary with reference Python planning/conversion/decoding. This is not native Arrow conversion validation or full Python parity.PermissionError. The incomplete raw summary and failed-execution receipt are preserved; that run is not accepted as passed. A complete repeat uses an independently verified 3 GiB JVM heap, with unchanged sources, worker, driver and plan.Measurements use macOS, Spark Connect 4.3.0, pandas 2.3.3, PyArrow 26.0.0 and one shared owned local server. Decimal workloads have 200,000 rows and two fields; string workloads have three fields. Each worker is a separate process. The following values are client
createDataFrameCPU / wall milliseconds. Complete output and schema validation ran outside the timer.Warm medians of five calls:
First measured call per workload: imports, session setup and input preparation precede these samples; later workloads follow earlier ones in their worker.
Observed warm CPU cost increased 5.2% at 1,000 rows and 1.6% at 200,000 rows versus master; warm wall time changed by +1.6% and approximately 0.0%. The candidate remains slower than Python on these two workloads; the already-landed fast path is part of the baseline. Whole-worker cumulative peak RSS was 163.1 MiB for master, 165.4 MiB for the candidate and 174.9 MiB for Python.
This is one fixed-order paired run without confidence intervals. RSS includes input preparation, expected tables, collection, validation and allocator retention. Guard-only cost, fallback/wide/nested workload performance, RPC/upload counts, conversion-only memory, process cold starts and whole-query performance are outside these measurements.
Was this patch authored or co-authored using generative AI tooling?
OpenAI Codex.
This pull request and its description were written by OpenAI Codex.