Skip to content

refactor: make_map_batch array handling#23228

Open
nathanb9 wants to merge 1 commit into
apache:mainfrom
nathanb9:issue-22833-make-map-refactor
Open

refactor: make_map_batch array handling#23228
nathanb9 wants to merge 1 commit into
apache:mainfrom
nathanb9:issue-22833-make-map-refactor

Conversation

@nathanb9

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Simplify make_map_batch array handling after scalar expansion.

What changes are included in this PR?

Pass extracted ArrayRefs through validation and map construction.

Are these changes tested?

Ran cargo fmt --all, cargo test -p datafusion-functions-nested map, and cargo clippy --all-targets --all-features -- -D warnings.

Are there any user-facing changes?

No.

@github-actions github-actions Bot added the functions Changes to functions implementation label Jun 28, 2026
@nathanb9 nathanb9 changed the title Refactor make_map_batch array handling refactor: make_map_batch array handling Jun 28, 2026
@nathanb9 nathanb9 marked this pull request as ready for review June 28, 2026 20:10
@comphead

Copy link
Copy Markdown
Contributor

run benchmark map

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c4834442569-735-fkp4h 6.12.85+ #1 SMP Mon May 11 08:17:35 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 issue-22833-make-map-refactor (41dfb46) to ea2ffdb (merge-base) diff using: map
Results will be posted here when complete


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 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                   HEAD                                   issue-22833-make-map-refactor
-----                   ----                                   -----------------------------
make_map_1000           1.01     72.0±1.40µs        ? ?/sec    1.00     71.6±1.36µs        ? ?/sec
map_1000_binary         1.00      8.9±0.02ms        ? ?/sec    1.04      9.2±0.02ms        ? ?/sec
map_1000_binary_view    1.00      8.6±0.03ms        ? ?/sec    1.05      9.1±0.05ms        ? ?/sec
map_1000_int32          1.00      4.7±0.01ms        ? ?/sec    1.02      4.8±0.02ms        ? ?/sec
map_1000_utf8           1.00      9.1±0.04ms        ? ?/sec    1.04      9.5±0.02ms        ? ?/sec
map_1000_utf8_view      1.00      8.9±0.03ms        ? ?/sec    1.05      9.4±0.03ms        ? ?/sec

Resource Usage

map — base (merge-base)

Metric Value
Wall time 350.1s
Peak memory 131.9 MiB
Avg memory 19.0 MiB
CPU user 73.4s
CPU sys 0.1s
Peak spill 0 B

map — branch

Metric Value
Wall time 330.1s
Peak memory 130.0 MiB
Avg memory 20.8 MiB
CPU user 73.5s
CPU sys 0.1s
Peak spill 0 B

File an issue against this benchmark runner

@comphead comphead 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.

Thanks @nathanb9 this makes sense!

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

Labels

functions Changes to functions implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor make_map_batch to avoid wrapping expanded arrays back in ColumnarValue

3 participants