Skip to content

perf(parquet): share Arrow write-schema plans across row groups - #11971

Open
HippoBaro wants to merge 4 commits into
apache:mainfrom
HippoBaro:share_write_schemas
Open

HippoBaro wants to merge 4 commits into
apache:mainfrom
HippoBaro:share_write_schemas

Conversation

@HippoBaro

@HippoBaro HippoBaro commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

The eager Arrow writer repeatedly derives the same schema-only field-to-leaf mapping when creating and validating row groups, even though that metadata is invariant for the lifetime of the writer factory.

What changes are included in this PR?

Build an immutable write-schema plan once per factory and share it across row groups and column writers. Reuse the cached target fields, leaf ranges, and Parquet descriptors for both ordinary and CDC paths, while continuing to derive leaves and levels from each incoming batch. This removes repeated schema traversal without retaining input arrays or changing dense, dictionary, REE, view, required-null, or leaf-ownership semantics.

Are these changes tested?

All tests passing.

Are there any significant user-facing changes?

None.

The eager Arrow writer repeatedly derives the same schema-only
field-to-leaf mapping when creating and validating row groups, even
though that metadata is invariant for the lifetime of the writer
factory.

Build an immutable write-schema plan once per factory and share it
across row groups and column writers. Reuse the cached target fields,
leaf ranges, and Parquet descriptors for both ordinary and CDC paths,
while continuing to derive leaves and levels from each incoming batch.
This removes repeated schema traversal without retaining input arrays
or changing dense, dictionary, REE, view, required-null, or
leaf-ownership semantics.

Signed-off-by: Hippolyte Barraud <hippolyte.barraud@datadoghq.com>
@github-actions github-actions Bot added the parquet Changes to the parquet crate label Oct 28, 2026
@HippoBaro

Copy link
Copy Markdown
Contributor Author

run benchmark arrow_writer
shards: 4

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark starting (GKE) | trigger

Target: arrow_writer

Sharding factor: 4 (4 workers).

Comparing share_write_schemas (ba9d4b8) to 7dcc160 (merge-base) diff

Run configuration
run benchmark arrow_writer
shards: 4

Results will be posted when all workers finish.


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Target: arrow_writer

Comparing share_write_schemas (ba9d4b8) to 7dcc160 (merge-base) diff

Run configuration
run benchmark arrow_writer
shards: 4

Comparison results: View the complete native critcmp output.

The comparison is published in an unlisted Gist because the original inline report exceeded GitHub's comment limit.

Per-runner information
arrow_writer — shard 1/4

Node: gk3-benchmark-cluster-nap-1kxn11uo-aeaf8131-9gtv

Instance: c4a-highmem-16 (12 vCPU / 65 GiB)

uname:

Linux bench-c6476522246-4077-lrzqw 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writer
CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected
Resource Usage

base (merge-base)

Metric Value
Wall time 1765.4s
Peak memory 2.0 GiB
Avg memory 194.0 MiB
CPU user 1731.1s
CPU sys 32.0s
Peak spill 0 B

branch

Metric Value
Wall time 1770.4s
Peak memory 1.9 GiB
Avg memory 195.6 MiB
CPU user 1734.3s
CPU sys 31.9s
Peak spill 0 B
arrow_writer — shard 2/4

Node: gk3-benchmark-cluster-nap-1kxn11uo-efb27e7d-nplg

Instance: c4a-highmem-16 (12 vCPU / 65 GiB)

uname:

Linux bench-c6476522246-4078-g44wc 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writer
CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected
Resource Usage

base (merge-base)

Metric Value
Wall time 1800.4s
Peak memory 2.2 GiB
Avg memory 350.2 MiB
CPU user 1750.4s
CPU sys 46.8s
Peak spill 0 B

branch

Metric Value
Wall time 1800.4s
Peak memory 2.2 GiB
Avg memory 342.3 MiB
CPU user 1750.9s
CPU sys 46.3s
Peak spill 0 B
arrow_writer — shard 3/4

Node: gk3-benchmark-cluster-nap-1kxn11uo-efb27e7d-mmq9

Instance: c4a-highmem-16 (12 vCPU / 65 GiB)

uname:

Linux bench-c6476522246-4079-qdcsz 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writer
CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected
Resource Usage

base (merge-base)

Metric Value
Wall time 1935.4s
Peak memory 2.2 GiB
Avg memory 287.1 MiB
CPU user 1888.5s
CPU sys 40.8s
Peak spill 0 B

branch

Metric Value
Wall time 1940.4s
Peak memory 2.2 GiB
Avg memory 283.3 MiB
CPU user 1894.1s
CPU sys 40.2s
Peak spill 0 B
arrow_writer — shard 4/4

Node: gk3-benchmark-cluster-nap-1kxn11uo-efb27e7d-wpl2

Instance: c4a-highmem-16 (12 vCPU / 65 GiB)

uname:

Linux bench-c6476522246-4080-4l7qn 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writer
CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected
Resource Usage

base (merge-base)

Metric Value
Wall time 1795.4s
Peak memory 2.0 GiB
Avg memory 222.7 MiB
CPU user 1759.2s
CPU sys 30.9s
Peak spill 0 B

branch

Metric Value
Wall time 1780.4s
Peak memory 2.1 GiB
Avg memory 222.4 MiB
CPU user 1746.8s
CPU sys 28.2s
Peak spill 0 B

File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark starting (GKE) | trigger

Target: writer_overhead

Sharding factor: 1 (1 workers).

Comparing share_write_schemas (ba9d4b8) to 7dcc160 (merge-base) diff

Run configuration
run benchmark writer_overhead
shards: 1

Results will be posted when all workers finish.


File an issue against this benchmark runner

@HippoBaro

Copy link
Copy Markdown
Contributor Author

run benchmark writer_overhead

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark starting (GKE) | trigger

Target: writer_overhead

Sharding factor: 1 (1 workers).

Comparing share_write_schemas (ba9d4b8) to 7dcc160 (merge-base) diff

Run configuration
run benchmark writer_overhead
shards: 1

Results will be posted when all workers finish.


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Target: writer_overhead

Comparing share_write_schemas (ba9d4b8) to 7dcc160 (merge-base) diff

Run configuration
run benchmark writer_overhead
shards: 1
Details
group                                         base                                   changed
-----                                         ----                                   -------
writer_overhead/10000_cols                    1.08     44.0±1.43ms        ? ?/sec    1.00     40.6±0.60ms        ? ?/sec
writer_overhead/1000_cols                     1.08      4.1±0.03ms        ? ?/sec    1.00      3.8±0.01ms        ? ?/sec
writer_overhead/1000_cols/repeated_batches    1.85     22.9±0.27ms        ? ?/sec    1.00     12.3±0.24ms        ? ?/sec
writer_overhead/5000_cols                     1.11     21.7±0.72ms        ? ?/sec    1.00     19.6±0.17ms        ? ?/sec
writer_overhead/5000_cols/repeated_batches    1.75    120.4±1.02ms        ? ?/sec    1.00     68.9±1.35ms        ? ?/sec

Per-runner information
writer_overhead — shard 1/1

Node: gk3-benchmark-cluster-nap-1qdxlfmx-b0cf750b-8frp

Instance: c4a-highmem-16 (12 vCPU / 65 GiB)

uname:

Linux bench-c6480251270-4092-69gb8 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench writer_overhead
CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected
Resource Usage

base (merge-base)

Metric Value
Wall time 70.0s
Peak memory 60.2 MiB
Avg memory 44.3 MiB
CPU user 64.3s
CPU sys 0.5s
Peak spill 0 B

branch

Metric Value
Wall time 60.0s
Peak memory 60.6 MiB
Avg memory 42.0 MiB
CPU user 54.0s
CPU sys 0.1s
Peak spill 0 B

File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Target: writer_overhead

Comparing share_write_schemas (ba9d4b8) to 7dcc160 (merge-base) diff

Run configuration
run benchmark writer_overhead
shards: 1
Details
group                                         base                                   changed
-----                                         ----                                   -------
writer_overhead/10000_cols                    1.08     41.6±1.13ms        ? ?/sec    1.00     38.5±0.52ms        ? ?/sec
writer_overhead/1000_cols                     1.08      4.1±0.02ms        ? ?/sec    1.00      3.8±0.01ms        ? ?/sec
writer_overhead/1000_cols/repeated_batches    1.86     22.0±0.24ms        ? ?/sec    1.00     11.8±0.09ms        ? ?/sec
writer_overhead/5000_cols                     1.10     20.8±0.69ms        ? ?/sec    1.00     18.9±0.06ms        ? ?/sec
writer_overhead/5000_cols/repeated_batches    1.68    113.1±1.61ms        ? ?/sec    1.00     67.5±3.18ms        ? ?/sec

Per-runner information
writer_overhead — shard 1/1

Node: gk3-benchmark-cluster-nap-1qdxlfmx-da3d3c4e-7q6k

Instance: c4a-highmem-16 (12 vCPU / 65 GiB)

uname:

Linux bench-c6480234757-4091-945f5 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench writer_overhead
CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected
Resource Usage

base (merge-base)

Metric Value
Wall time 65.0s
Peak memory 60.2 MiB
Avg memory 45.6 MiB
CPU user 61.4s
CPU sys 0.4s
Peak spill 0 B

branch

Metric Value
Wall time 55.0s
Peak memory 60.6 MiB
Avg memory 42.2 MiB
CPU user 50.7s
CPU sys 1.3s
Peak spill 0 B

File an issue against this benchmark runner

@HippoBaro

Copy link
Copy Markdown
Contributor Author

@adriangb This is a nice perf improvement for the benchmarks you added in #10878

Comment thread parquet/src/arrow/arrow_writer/mod.rs Outdated
Comment on lines +1474 to +1476
let schema_plan =
ArrowWriteSchemaPlan::try_new(file_writer.schema_descr_ptr().as_ref(), &arrow_schema)
.map(Arc::new);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like the ceremony of storing errors for later use is to avoid changing the signature on this function (ArrowRowGroupWriterFactory::new, which is public). But it feels to me that the right long-term shape is to add ArrowRowGroupWriterFactory::try_new(...) -> Result<...>. I would suggest we add that method and either:
(1) Remove new() as a hard breaking change (but an easy one to fix, I'd guess 1 LOC in datafusion or any downstream). It should be fine to ship in next major release.
(2) Keep new() and have it use this machinery internally, but deprecate it and suggest using try_new instead. We could at least remove this complexity in the future.

If we go with (2) we may have some bugs to fix. My agent claims that ParquetError::ArrowError would end up in General. I did not verify this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn, thanks for catching that. I fixed the error type in 97447bd, but left the API question open for discussion.

@alamb, I know you generally prefer avoiding breaking changes. Do you have a preference here? It feels like (2) mostly delays the inevitable, so I’m inclined to bite the bullet now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's worth doing a quick (AI assisted) survey of call-sites at least in DataFusion. But I agree it's worth just biting the bullet and making the breaking change (1).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alamb, I know you generally prefer avoiding breaking changes. Do you have a preference here? It feels like (2) mostly delays the inevitable, so I’m inclined to bite the bullet now.

We can make the breaking change, but then we would need to wait for the next major release

Retain the ArrowError variant and original message when caching and
replaying schema-plan failures instead of converting them to `General`.

Add regression coverage for error variant and message preservation,
including repeated factory calls with nullable map-key schemas.

Signed-off-by: Hippolyte Barraud <hippolyte.barraud@datadoghq.com>
@HippoBaro
HippoBaro force-pushed the share_write_schemas branch from b7844da to 97447bd Compare October 29, 2026 03:17
@alamb alamb added the api-change Breaking API change, needs to wait for a major version release label Oct 29, 2026
Add `ArrowRowGroupWriterFactory::try_new` to return schema-planning
errors immediately while preserving the original ParquetError.

Deprecate `new()`` for removal in 61.0.0, retaining its deferred-error
behavior for compatibility. Document the cached-error state and
cleanup needed when the deprecated constructor is removed.

Migrate internal callers, examples, benchmarks, and integration tests
to try_new(). Extend tests to verify immediate and deferred failures.

Signed-off-by: Hippolyte Barraud <hippolyte.barraud@datadoghq.com>
@HippoBaro

Copy link
Copy Markdown
Contributor Author

@etseidl @adriangb 33f6549 adds the new try_new constructor as suggested, deprecates the existing one and schedules it for removal in 61.0.0.

I propose we merge this as-is since it doesn’t break existing users. I’ll open a separate PR for the actual API removal so we can apply the api-change label there. That also lets me keep merging the remaining pieces from #11273 without being blocked on this.

Thanks!

@adriangb

Copy link
Copy Markdown
Contributor

Sounds good. I'm worried about the complexity of manually passing around and re-surfacing errors, but it seems like it might be the right tradeoff to avoid a breaking change. If it causes issues we can always remove it as a bugfix, and we'll remove it before next version anyway.

@etseidl etseidl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm feeling deja vu...haven't we been here before 😉

Looks good to me (and my agent). One minor nit I found on my own (it's probably wrong :P)

Comment thread parquet/src/arrow/arrow_writer/mod.rs Outdated
Co-authored-by: Ed Seidl <etseidl@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-change Breaking API change, needs to wait for a major version release parquet Changes to the parquet crate performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants