Skip to content

Use Thrift macro to generate Parquet LogicalType serialization code#9997

Draft
etseidl wants to merge 13 commits into
apache:mainfrom
etseidl:logical_type_macro
Draft

Use Thrift macro to generate Parquet LogicalType serialization code#9997
etseidl wants to merge 13 commits into
apache:mainfrom
etseidl:logical_type_macro

Conversation

@etseidl
Copy link
Copy Markdown
Contributor

@etseidl etseidl commented May 18, 2026

Which issue does this PR close?

Rationale for this change

See issue. Improve code maintainability by using thrift macro to generate LogicalType serialization code.

What changes are included in this PR?

Adds a new macro to generate code for a Thrift union that needs to be forward compatible. Does this by adding a catchall _Unknown variant for unknown field ids.

Are there any user-facing changes?

Yes this is a breaking API change because the LogicalType enum will now use tuple variants rather than struct. This also makes public some structs that were previously private.

@etseidl etseidl added the api-change Changes to the arrow API label May 18, 2026
@github-actions github-actions Bot added parquet Changes to the parquet crate parquet-derive labels May 18, 2026
@etseidl etseidl changed the title Logical type macro Use Thrift macro to generate Parquet LogicalType serialization code May 18, 2026
@etseidl
Copy link
Copy Markdown
Contributor Author

etseidl commented May 18, 2026

Depends on #9996, so keeping draft for now

@etseidl
Copy link
Copy Markdown
Contributor Author

etseidl commented May 18, 2026

run benchmark metadata

@adriangbot
Copy link
Copy Markdown

🤖 Arrow criterion benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c4482974990-190-55z2p 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux

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

Comparing logical_type_macro (39a4bc1) to fd1c5b3 (merge-base) diff
BENCH_NAME=metadata
BENCH_COMMAND=cargo bench --features=arrow,async,test_common,experimental,object_store --bench metadata
BENCH_FILTER=
Results will be posted here when complete


File an issue against this benchmark runner

@adriangbot
Copy link
Copy Markdown

🤖 Arrow criterion benchmark completed (GKE) | trigger

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

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
Details

group                                               logical_type_macro                     main
-----                                               ------------------                     ----
decode metadata (wide) with schema                  1.01     28.2±0.40ms        ? ?/sec    1.00     27.8±0.37ms        ? ?/sec
decode metadata (wide) with skip PES                1.01     28.7±0.32ms        ? ?/sec    1.00     28.3±0.35ms        ? ?/sec
decode metadata (wide) with skip all stats          1.00     32.2±0.22ms        ? ?/sec    1.00     32.2±0.19ms        ? ?/sec
decode metadata (wide) with skip column stats       1.01     29.6±0.33ms        ? ?/sec    1.00     29.3±0.33ms        ? ?/sec
decode metadata (wide) with skip size stats         1.01     32.7±0.34ms        ? ?/sec    1.00     32.4±0.35ms        ? ?/sec
decode metadata (wide) with stats mask              1.01     27.6±0.38ms        ? ?/sec    1.00     27.3±0.38ms        ? ?/sec
decode metadata with schema                         1.00      4.1±0.01µs        ? ?/sec    1.01      4.1±0.01µs        ? ?/sec
decode metadata with skip PES                       1.00      7.0±0.06µs        ? ?/sec    1.01      7.1±0.02µs        ? ?/sec
decode metadata with skip column stats              1.00      6.8±0.08µs        ? ?/sec    1.01      6.9±0.03µs        ? ?/sec
decode metadata with stats mask                     1.00      6.9±0.07µs        ? ?/sec    1.00      6.9±0.02µs        ? ?/sec
decode parquet metadata                             1.00      7.2±0.06µs        ? ?/sec    1.01      7.3±0.02µs        ? ?/sec
decode parquet metadata (wide)                      1.01     30.2±0.38ms        ? ?/sec    1.00     29.9±0.36ms        ? ?/sec
decode parquet metadata no path_in_schema (wide)    1.01     29.4±0.42ms        ? ?/sec    1.00     29.1±0.39ms        ? ?/sec
decode parquet metadata w/ size stats (wide)        1.01     36.2±0.39ms        ? ?/sec    1.00     35.7±0.41ms        ? ?/sec
open(default)                                       1.00      7.8±0.04µs        ? ?/sec    1.00      7.9±0.02µs        ? ?/sec
open(page index)                                    1.00    132.9±0.11µs        ? ?/sec    1.02    135.3±4.52µs        ? ?/sec

Resource Usage

base (merge-base)

Metric Value
Wall time 160.0s
Peak memory 4.3 GiB
Avg memory 4.2 GiB
CPU user 156.6s
CPU sys 0.8s
Peak spill 0 B

branch

Metric Value
Wall time 160.0s
Peak memory 4.2 GiB
Avg memory 4.2 GiB
CPU user 156.8s
CPU sys 0.2s
Peak spill 0 B

File an issue against this benchmark runner

@etseidl
Copy link
Copy Markdown
Contributor Author

etseidl commented May 18, 2026

run benchmark parquet_round_trip

@adriangbot
Copy link
Copy Markdown

🤖 Arrow criterion benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c4483061658-191-h4wrd 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux

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

Comparing logical_type_macro (50c5168) to fd1c5b3 (merge-base) diff
BENCH_NAME=parquet_round_trip
BENCH_COMMAND=cargo bench --features=arrow,async,test_common,experimental,object_store --bench parquet_round_trip
BENCH_FILTER=
Results will be posted here when complete


File an issue against this benchmark runner

@adriangbot
Copy link
Copy Markdown

🤖 Arrow criterion benchmark completed (GKE) | trigger

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

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
Details

group                                     logical_type_macro                     main
-----                                     ------------------                     ----
read Binary(100) delta_byte_array         1.00      8.6±0.10ms        ? ?/sec    1.02      8.8±0.06ms        ? ?/sec
read Binary(100) delta_length             1.00      3.0±0.05ms        ? ?/sec    1.10      3.3±0.06ms        ? ?/sec
read Binary(100) dict                     1.00      3.9±0.01ms        ? ?/sec    1.03      4.0±0.02ms        ? ?/sec
read Binary(100) plain                    1.00      4.0±0.11ms        ? ?/sec    1.06      4.3±0.09ms        ? ?/sec
read Binary(20) delta_byte_array          1.00      4.8±0.03ms        ? ?/sec    1.01      4.8±0.02ms        ? ?/sec
read Binary(20) delta_length              1.00  1866.2±15.16µs        ? ?/sec    1.00  1874.1±19.01µs        ? ?/sec
read Binary(20) dict                      1.00      2.6±0.00ms        ? ?/sec    1.02      2.6±0.03ms        ? ?/sec
read Binary(20) plain                     1.00      2.9±0.07ms        ? ?/sec    1.02      2.9±0.07ms        ? ?/sec
read Fixed(16) byte_stream_split          1.00      5.4±0.01ms        ? ?/sec    1.00      5.4±0.02ms        ? ?/sec
read Fixed(16) delta_byte_array           1.00      3.3±0.01ms        ? ?/sec    1.00      3.3±0.01ms        ? ?/sec
read Fixed(16) dict                       1.00    626.4±3.60µs        ? ?/sec    1.00    628.8±3.34µs        ? ?/sec
read Fixed(16) plain                      1.00    633.3±4.72µs        ? ?/sec    1.00    630.9±3.31µs        ? ?/sec
read Fixed(2) byte_stream_split           1.09    930.7±1.86µs        ? ?/sec    1.00    857.4±2.28µs        ? ?/sec
read Fixed(2) delta_byte_array            1.00      3.2±0.01ms        ? ?/sec    1.00      3.2±0.01ms        ? ?/sec
read Fixed(2) dict                        1.00    435.2±1.49µs        ? ?/sec    1.01    439.0±1.03µs        ? ?/sec
read Fixed(2) plain                       1.00    436.8±1.20µs        ? ?/sec    1.01    440.9±1.47µs        ? ?/sec
read String(100) delta_byte_array         1.00      9.4±0.05ms        ? ?/sec    1.01      9.5±0.03ms        ? ?/sec
read String(100) delta_length             1.00      4.0±0.06ms        ? ?/sec    1.01      4.0±0.08ms        ? ?/sec
read String(100) dict                     1.00      3.8±0.01ms        ? ?/sec    1.04      4.0±0.01ms        ? ?/sec
read String(100) plain                    1.08      4.9±0.11ms        ? ?/sec    1.00      4.6±0.06ms        ? ?/sec
read String(20) delta_byte_array          1.00      5.2±0.06ms        ? ?/sec    1.00      5.2±0.01ms        ? ?/sec
read String(20) delta_length              1.00   1995.6±6.62µs        ? ?/sec    1.00      2.0±0.01ms        ? ?/sec
read String(20) dict                      1.00      2.6±0.00ms        ? ?/sec    1.01      2.6±0.01ms        ? ?/sec
read String(20) plain                     1.00      3.0±0.07ms        ? ?/sec    1.00      3.0±0.07ms        ? ?/sec
read StringView(100) delta_byte_array     1.00      8.3±0.13ms        ? ?/sec    1.04      8.7±0.12ms        ? ?/sec
read StringView(100) delta_length         1.03      4.3±0.17ms        ? ?/sec    1.00      4.2±0.16ms        ? ?/sec
read StringView(100) dict                 1.00    997.5±2.13µs        ? ?/sec    1.00    994.7±3.61µs        ? ?/sec
read StringView(100) plain                1.00      3.8±0.41ms        ? ?/sec    1.20      4.6±0.15ms        ? ?/sec
read StringView(20) delta_byte_array      1.00      4.9±0.01ms        ? ?/sec    1.07      5.2±0.04ms        ? ?/sec
read StringView(20) delta_length          1.01      2.5±0.01ms        ? ?/sec    1.00      2.5±0.01ms        ? ?/sec
read StringView(20) dict                  1.00    990.1±1.47µs        ? ?/sec    1.00    986.4±2.72µs        ? ?/sec
read StringView(20) plain                 1.01   1664.9±5.96µs        ? ?/sec    1.00   1655.5±8.25µs        ? ?/sec
read f32 byte_stream_split                1.00   1018.2±2.01µs        ? ?/sec    1.00   1015.4±3.59µs        ? ?/sec
read f32 dict                             1.00   1448.3±2.77µs        ? ?/sec    1.00   1443.0±3.17µs        ? ?/sec
read f32 plain                            1.00    956.7±1.94µs        ? ?/sec    1.00    959.3±6.18µs        ? ?/sec
read f64 byte_stream_split                1.00   1525.3±3.43µs        ? ?/sec    1.00   1528.5±3.31µs        ? ?/sec
read f64 dict                             1.01   1482.9±2.21µs        ? ?/sec    1.00   1471.0±3.49µs        ? ?/sec
read f64 plain                            1.02   1104.9±3.92µs        ? ?/sec    1.00   1087.3±5.01µs        ? ?/sec
read int32 byte_stream_split              1.00   1078.8±4.78µs        ? ?/sec    1.00   1075.7±2.74µs        ? ?/sec
read int32 delta_binary                   1.00      2.1±0.02ms        ? ?/sec    1.00      2.1±0.01ms        ? ?/sec
read int32 dict                           1.00   1513.3±6.54µs        ? ?/sec    1.00   1517.2±3.21µs        ? ?/sec
read int32 plain                          1.00   1007.1±3.48µs        ? ?/sec    1.01   1015.7±5.71µs        ? ?/sec
read int64 byte_stream_split              1.00   1592.6±5.37µs        ? ?/sec    1.00   1591.0±6.05µs        ? ?/sec
read int64 delta_binary                   1.00      2.4±0.02ms        ? ?/sec    1.00      2.4±0.02ms        ? ?/sec
read int64 dict                           1.00   1549.3±5.91µs        ? ?/sec    1.00   1545.8±4.91µs        ? ?/sec
read int64 plain                          1.00   1153.8±5.48µs        ? ?/sec    1.00   1149.9±5.27µs        ? ?/sec
write Binary(100) delta_byte_array        1.12     19.0±3.10ms        ? ?/sec    1.00     17.0±0.04ms        ? ?/sec
write Binary(100) delta_length            1.03     15.1±1.49ms        ? ?/sec    1.00     14.7±1.14ms        ? ?/sec
write Binary(100) dict                    1.00     17.6±0.05ms        ? ?/sec    1.00     17.6±0.03ms        ? ?/sec
write Binary(100) plain                   1.00     12.4±0.03ms        ? ?/sec    1.01     12.6±0.08ms        ? ?/sec
write Binary(20) delta_byte_array         1.00     12.6±0.03ms        ? ?/sec    1.00     12.6±0.02ms        ? ?/sec
write Binary(20) delta_length             1.00      9.4±0.03ms        ? ?/sec    1.00      9.4±0.03ms        ? ?/sec
write Binary(20) dict                     1.00     13.1±0.03ms        ? ?/sec    1.00     13.1±0.03ms        ? ?/sec
write Binary(20) plain                    1.00      8.1±0.03ms        ? ?/sec    1.00      8.1±0.02ms        ? ?/sec
write Fixed(16) byte_stream_split         1.00     27.4±0.12ms        ? ?/sec    1.00     27.3±0.17ms        ? ?/sec
write Fixed(16) delta_byte_array          1.00     64.9±0.22ms        ? ?/sec    1.00     64.8±0.23ms        ? ?/sec
write Fixed(16) dict                      1.00     22.8±0.15ms        ? ?/sec    1.00     22.8±0.12ms        ? ?/sec
write Fixed(16) plain                     1.00     22.8±0.15ms        ? ?/sec    1.00     22.8±0.13ms        ? ?/sec
write Fixed(2) byte_stream_split          1.00     21.4±0.09ms        ? ?/sec    1.01     21.5±0.07ms        ? ?/sec
write Fixed(2) delta_byte_array           1.00     63.4±0.18ms        ? ?/sec    1.00     63.5±0.19ms        ? ?/sec
write Fixed(2) dict                       1.00     22.2±0.08ms        ? ?/sec    1.00     22.2±0.07ms        ? ?/sec
write Fixed(2) plain                      1.00     22.2±0.08ms        ? ?/sec    1.00     22.2±0.08ms        ? ?/sec
write String(100) delta_byte_array        1.00     26.2±0.09ms        ? ?/sec    1.02     26.6±0.08ms        ? ?/sec
write String(100) delta_length            1.00     22.4±0.05ms        ? ?/sec    1.01     22.7±0.05ms        ? ?/sec
write String(100) dict                    1.00     17.6±0.03ms        ? ?/sec    1.00     17.6±0.03ms        ? ?/sec
write String(100) plain                   1.00     12.4±0.03ms        ? ?/sec    1.00     12.5±0.03ms        ? ?/sec
write String(20) delta_byte_array         1.00     12.9±0.03ms        ? ?/sec    1.00     12.9±0.03ms        ? ?/sec
write String(20) delta_length             1.00      9.4±0.03ms        ? ?/sec    1.00      9.4±0.02ms        ? ?/sec
write String(20) dict                     1.00     13.1±0.03ms        ? ?/sec    1.00     13.2±0.03ms        ? ?/sec
write String(20) plain                    1.00      8.1±0.01ms        ? ?/sec    1.01      8.2±0.02ms        ? ?/sec
write StringView(100) delta_byte_array    1.34     26.7±0.08ms        ? ?/sec    1.00     19.9±1.59ms        ? ?/sec
write StringView(100) delta_length        1.62     22.8±0.13ms        ? ?/sec    1.00     14.0±0.33ms        ? ?/sec
write StringView(100) dict                1.00     18.5±0.03ms        ? ?/sec    1.00     18.5±0.04ms        ? ?/sec
write StringView(100) plain               1.00     12.6±0.04ms        ? ?/sec    1.02     12.8±0.05ms        ? ?/sec
write StringView(20) delta_byte_array     1.00     12.8±0.02ms        ? ?/sec    1.00     12.7±0.03ms        ? ?/sec
write StringView(20) delta_length         1.00      9.4±0.02ms        ? ?/sec    1.00      9.4±0.02ms        ? ?/sec
write StringView(20) dict                 1.00     13.4±0.03ms        ? ?/sec    1.00     13.4±0.04ms        ? ?/sec
write StringView(20) plain                1.00      8.0±0.02ms        ? ?/sec    1.00      8.0±0.02ms        ? ?/sec
write f32 byte_stream_split               1.00      5.1±0.04ms        ? ?/sec    1.00      5.1±0.04ms        ? ?/sec
write f32 dict                            1.00     15.6±0.27ms        ? ?/sec    1.03     16.0±0.03ms        ? ?/sec
write f32 plain                           1.00      5.1±0.04ms        ? ?/sec    1.00      5.1±0.03ms        ? ?/sec
write f64 byte_stream_split               1.00      6.8±0.03ms        ? ?/sec    1.01      6.9±0.03ms        ? ?/sec
write f64 dict                            1.00     15.7±0.28ms        ? ?/sec    1.02     16.0±0.04ms        ? ?/sec
write f64 plain                           1.00      5.9±0.03ms        ? ?/sec    1.01      5.9±0.03ms        ? ?/sec
write int32 byte_stream_split             1.00      5.4±0.03ms        ? ?/sec    1.00      5.4±0.03ms        ? ?/sec
write int32 delta_binary                  1.00     10.8±0.07ms        ? ?/sec    1.00     10.7±0.04ms        ? ?/sec
write int32 dict                          1.00     16.4±0.33ms        ? ?/sec    1.02     16.8±0.10ms        ? ?/sec
write int32 plain                         1.00      5.5±0.03ms        ? ?/sec    1.00      5.5±0.02ms        ? ?/sec
write int64 byte_stream_split             1.00      6.9±0.04ms        ? ?/sec    1.00      6.9±0.04ms        ? ?/sec
write int64 delta_binary                  1.00     12.0±0.10ms        ? ?/sec    1.00     12.0±0.05ms        ? ?/sec
write int64 dict                          1.00     16.0±0.34ms        ? ?/sec    1.02     16.4±0.07ms        ? ?/sec
write int64 plain                         1.00      6.2±0.04ms        ? ?/sec    1.00      6.2±0.04ms        ? ?/sec

Resource Usage

base (merge-base)

Metric Value
Wall time 940.2s
Peak memory 8.9 GiB
Avg memory 5.4 GiB
CPU user 908.3s
CPU sys 30.8s
Peak spill 0 B

branch

Metric Value
Wall time 935.2s
Peak memory 8.9 GiB
Avg memory 5.3 GiB
CPU user 899.9s
CPU sys 34.2s
Peak spill 0 B

File an issue against this benchmark runner

@etseidl
Copy link
Copy Markdown
Contributor Author

etseidl commented May 20, 2026

run benchmark metadata

@adriangbot
Copy link
Copy Markdown

🤖 Arrow criterion benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c4502580887-245-wsf4s 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux

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

Comparing logical_type_macro (b9ff17a) to 73c513a (merge-base) diff
BENCH_NAME=metadata
BENCH_COMMAND=cargo bench --features=arrow,async,test_common,experimental,object_store --bench metadata
BENCH_FILTER=
Results will be posted here when complete


File an issue against this benchmark runner

@adriangbot
Copy link
Copy Markdown

🤖 Arrow criterion benchmark completed (GKE) | trigger

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

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
Details

group                                               logical_type_macro                     main
-----                                               ------------------                     ----
decode metadata (wide) with schema                  1.00     27.0±0.49ms        ? ?/sec    1.05     28.2±0.27ms        ? ?/sec
decode metadata (wide) with skip PES                1.00     27.4±0.54ms        ? ?/sec    1.04     28.6±0.14ms        ? ?/sec
decode metadata (wide) with skip all stats          1.00     31.4±0.46ms        ? ?/sec    1.03     32.3±0.23ms        ? ?/sec
decode metadata (wide) with skip column stats       1.00     28.7±0.61ms        ? ?/sec    1.03     29.4±0.30ms        ? ?/sec
decode metadata (wide) with skip size stats         1.00     32.1±0.52ms        ? ?/sec    1.03     32.9±0.17ms        ? ?/sec
decode metadata (wide) with stats mask              1.00     26.7±0.53ms        ? ?/sec    1.03     27.6±0.20ms        ? ?/sec
decode metadata with schema                         1.00      4.0±0.03µs        ? ?/sec    1.03      4.2±0.01µs        ? ?/sec
decode metadata with skip PES                       1.00      7.0±0.04µs        ? ?/sec    1.02      7.1±0.01µs        ? ?/sec
decode metadata with skip column stats              1.00      6.8±0.04µs        ? ?/sec    1.02      6.9±0.05µs        ? ?/sec
decode metadata with stats mask                     1.00      6.8±0.06µs        ? ?/sec    1.03      7.0±0.04µs        ? ?/sec
decode parquet metadata                             1.00      7.1±0.03µs        ? ?/sec    1.01      7.2±0.02µs        ? ?/sec
decode parquet metadata (wide)                      1.00     29.2±0.52ms        ? ?/sec    1.05     30.6±0.34ms        ? ?/sec
decode parquet metadata no path_in_schema (wide)    1.00     28.5±0.51ms        ? ?/sec    1.04     29.5±0.25ms        ? ?/sec
decode parquet metadata w/ size stats (wide)        1.00     35.7±0.67ms        ? ?/sec    1.01     36.2±0.21ms        ? ?/sec
open(default)                                       1.00      7.7±0.04µs        ? ?/sec    1.01      7.9±0.02µs        ? ?/sec
open(page index)                                    1.00    132.3±0.16µs        ? ?/sec    1.00    132.7±0.16µs        ? ?/sec

Resource Usage

base (merge-base)

Metric Value
Wall time 160.0s
Peak memory 4.3 GiB
Avg memory 4.2 GiB
CPU user 157.8s
CPU sys 0.8s
Peak spill 0 B

branch

Metric Value
Wall time 155.0s
Peak memory 4.2 GiB
Avg memory 4.2 GiB
CPU user 153.9s
CPU sys 0.2s
Peak spill 0 B

File an issue against this benchmark runner

Comment on lines +626 to +636
// An earlier version of this crate enforced this when decoding LogicalType. Now that
// the decoder is macro generated, we do this to preserve the original behavior.
// TODO: this was done due to a line in the spec saying an unset algorithm defaults
// to SPHERICAL. But there is no default in the Thrift, so it would be better to set the
// default when consumed.
// See https://github.com/apache/parquet-format/blob/master/LogicalTypes.md#geography
for se in schema.iter_mut() {
match se.logical_type.as_mut() {
Some(LogicalType::Geography(g)) if g.algorithm.is_none() => {
g.algorithm = Some(Default::default());
}
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.

@paleolimbot I'm wondering if this is still necessary, or if this can be enforced where the logical type is consumed. For instance, the one place I could find where removing this logic would have an impact is when handling the extension type.

        LogicalType::Geography(geography) => {
            let algorithm = geography.algorithm.map(|a| a.try_as_edges()).transpose()?;
            let md = parquet_geospatial::WkbMetadata::new(geography.crs.as_deref(), algorithm);
        ...
        }

could instead be

        LogicalType::Geography(geography) => {
            // if algorithm is None, then set to the default (EdgeInterpolationAlgorithm::SPERICAL).
            let algorithm = geography.algorithm.or(Some(Default::default()));
            let algorithm = algorithm.map(|a| a.try_as_edges()).transpose()?;
            let md = parquet_geospatial::WkbMetadata::new(geography.crs.as_deref(), algorithm);
        ...
        }

Would removing this cause a lot of thrash downstream?

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

Labels

api-change Changes to the arrow API parquet Changes to the parquet crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Switch Parquet LogicalType enum to macro generated version

2 participants