Skip to content

Build Not yet confirmed elsewhere1 publisher 2 min read Published

PySpark's Arrow paths became defaults in Spark 4.2 after a ticket filed in 2016

Spark 4.2 makes the Arrow paths PySpark's defaults, according to a dev.to history of how the format reached each JVM-to-Python boundary. Teams upgrading get that serialization without opting in, so jobs with UDFs and pandas conversions need a test run first.

The Engineer · Build desk

How we use AI Send a correction

Illustration accompanying PySpark's Arrow paths became defaults in Spark 4.2 after a ticket filed in 2016
Generated illustration
Per-row machinery outweighs a tiny UDF's work Per-row costs a dev.to post describes for a simple UDF, beside how many values a cache line holds when columns are stored contiguously.

Key figures from a dev.to post: three orders of magnitude of overhead wrapped around a UDF like return x * 1.1; four serialization steps paid by every row; and eight useful int64 values in a 64-byte cache line when columns are stored contiguously, instead of one row's mixed fields.

Per-row machinery outweighs a tiny UDF's work
FigureValueNoteClaim
Orders of magnitude of overhead around a UDF like x * 1.13 orders18
Serialization steps per row4 steps11
Useful int64 values per 64-byte cache line8 int64 valueswith columns stored contiguously14

What happened

  • Wes McKinney filed SPARK-13534 on February 28, 2016, asking for one method, toPandas(), to stop using pickle. It took two years to ship.
  • The same idea then went through UDFs, partition-level APIs, the Spark Connect network protocol and custom data sources.
  • Spark 4.1 let Python functions take Spark's data as Arrow arrays, with pandas left out entirely.
  • According to the post, the conversion that remains now lives inside Spark's own engine.

Why it matters

  • decision Teams moving to 4.2 get Arrow paths they did not turn on, so every place their code pulls data out of the JVM becomes a behavior change to test as well as a speedup.
  • constraint The overhead case rests on a one-line UDF. Jobs whose functions do real work per row spend a smaller share of runtime on serialization and will see less.
  • exposure The 4.2 default flip is stated in one sentence of a single blog post that does not list the settings involved, so a migration plan built on it alone needs the release notes to confirm which paths changed.

Before Arrow, every row crossed on its own. For most of Spark's life pickle was the only route, and it carried a single row per trip [10]. Each row paid four serialization steps and a function call [11]. For a UDF like `return x * 1.1`, the post says, the arithmetic takes nanoseconds and the machinery around it takes microseconds, three orders of magnitude of overhead around almost no work [18]. The multiplication was the cheap part.

Arrow's idea is to agree on the bytes. It specifies a language-independent, columnar, in-memory layout down to byte alignment, null bitmaps and buffer order, so any two systems that understand Arrow can pass data between them with no conversion step [12]. Inside a single process, or in shared memory, the hand-off is zero-copy. Across a socket it is still a copy, but neither side decodes row by row, because the bytes on the wire are already the bytes in memory [13]. Columnar storage helps the CPU as well: a 64-byte cache line fills with eight int64 values that are all useful, where row storage would fill it with one row's mixed fields [14]. The post leans on the MonetDB/X100 paper (CIDR 2005), which argued that pushing batches of around a thousand column values through each operator is an order of magnitude or two faster than going one row at a time [15].

The fixes came one door at a time because PySpark is a Python client for a JVM engine. Python builds the query plan and the JVM executes it, so DataFrame code runs at the same speed in PySpark and Scala [8]. Data crosses only when your own code needs it [9]. McKinney's ticket, titled "Implement Apache Arrow serializer for Spark DataFrame for use in DataFrame.toPandas," covered one such crossing [3]. He filed it in the same month Arrow was announced as an Apache top-level project [2][16].

The author's framing is that each release removed one conversion at one boundary, and that what each left behind explains the next [1]. On that account, Arrow arrays handed straight to Python functions in Spark 4.1 and the 4.2 defaults arrived in adjacent minor releases [5][6][17].

In our view the upgrade work is an inventory of your own crossings: every UDF, every `toPandas()` call, every `createDataFrame(pandas_df)` call and every custom data source [9].

What to watch

  • The Spark 4.2 release notes and migration guide, which would show exactly which settings and paths the default change covers.
  • Measurements of the 4.2 defaults on UDFs that do real work per row, since the post's overhead figure comes from a one-line function.

Clarity's read

What the record supports and how the coverage leans. The claims behind it follow.

Reality

Evidence55
Adoption
Insufficient
Hype gap+10
Incentives
Insufficient
Confidence58
Why these scores

Claim ledger

Ranked by verification strength, evidence, and original report placement.

  1. [1]

    Arrow's contribution to PySpark is a shared memory format at every boundary between the JVM and Python; each release removed one conversion at one boundary, and what each one left behind explains the next.

    Reported Supported Source: dev.to post, 'Explaining the Python-JVM Boundary in Spark, and What Arrow Changed'View cited source
  2. [2]

    Wes McKinney filed SPARK-13534 on February 28, 2016, asking for one method, DataFrame.toPandas, to stop using pickle; it took two years to ship.

    Reported Supported Source: dev.to postView cited source
  3. [3]

    The ticket was titled "Implement Apache Arrow serializer for Spark DataFrame for use in DataFrame.toPandas."

    Reported Supported Source: dev.to post, quoting the title of SPARK-13534View cited source

Get this ledger inside ChatGPT. Ask about any of our stories and the answer brings its figure, each claim’s verdict and the sources. Free, no account.

Add to ChatGPTAdd to Claude

Sources

1 independent publisher whose own reporting we read for this story.

  1. dev.to

    1 article · October 13, 2026

    Explaining the Python-JVM Boundary in Spark, and What Arrow Changed

Share your take

Let Clarity write the post for you.

Signed-in readers get a short post drafted on this story in the register they choose — narrative, analytical, or a direct position — editable to the last word before it goes anywhere. The share buttons at the top of this story work without an account.

Topics and entities

Follow any of these and your For You feed starts watching them — no settings page required.

Topics

Loading related stories