You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "liamzwbao (via GitHub)" <gi...@apache.org> on 2026/07/19 03:33:11 UTC

[PR] [arrow-select] minor: Replace `ArrayData` with direct `Array` construction in concat [arrow-rs]

liamzwbao opened a new pull request, #10377:
URL: https://github.com/apache/arrow-rs/pull/10377

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax.
   -->
   
   - Part of #9298 .
   
   # Rationale for this change
   
   <!--
   Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
   Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
   -->
   
   # What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   Switch usage of `ArrayData` with direct `Array` construction in concat and in some tests
   
   # Are these changes tested?
   
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
   
   If this PR claims a performance improvement, please include evidence such as benchmark results.
   -->
   
   Covered by existing tests
   
   # Are there any user-facing changes?
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   
   If there are any breaking changes to public APIs, please call them out.
   -->
   No


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [arrow-select] perf: Replace `ArrayData` with direct `Array` construction in concat [arrow-rs]

Posted by "adriangbot (via GitHub)" <gi...@apache.org>.
adriangbot commented on PR #10377:
URL: https://github.com/apache/arrow-rs/pull/10377#issuecomment-5753081897

   🤖 Arrow criterion benchmark running (GKE) | [trigger](https://github.com/apache/arrow-rs/pull/10377#issuecomment-5753067585)
   **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c5753067585-2534-c7hlx 6.12.94+ #1 SMP Tue Aug  4 08:44:15 UTC 2026 aarch64 GNU/Linux`
   <details><summary>CPU Details (lscpu)</summary>
   
   ```
   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>
   
   Comparing issue-9298-concat-array-data (3ce20877b014f45524420fbebd8f21dcb5b0dc3a) to 4cd8be9 (merge-base) [diff](https://github.com/apache/arrow-rs/compare/4cd8be954f6bc6b6dd265140207365b59a9900ec..3ce20877b014f45524420fbebd8f21dcb5b0dc3a)
   
   <details><summary>Run configuration</summary>
   
   ```yaml
   run benchmark coalesce_kernels
   env:
     BENCH_FILTER: "run_end"
   ```
   
   </details>
   
   BENCH_COMMAND=cargo bench --features=arrow,async,test_common,experimental,object_store --bench coalesce_kernels
   Results will be posted here when complete
   
   ---
   [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [arrow-select] perf: Replace `ArrayData` with direct `Array` construction in concat [arrow-rs]

Posted by "adriangbot (via GitHub)" <gi...@apache.org>.
adriangbot commented on PR #10377:
URL: https://github.com/apache/arrow-rs/pull/10377#issuecomment-5753088047

   Benchmark for [this request](https://github.com/apache/arrow-rs/pull/10377#issuecomment-5753067585) failed before finishing (Kubernetes reason: `BackoffLimitExceeded`).
   
   Benchmarks requested: `coalesce_kernels`
   
   <details><summary>Runner log (last 40 lines)</summary>
   
   ```
   2026-09-20T22:17:57.237110Z  INFO runner starting benchmark runner bench_type=ArrowCriterion, pr_url=https://github.com/apache/arrow-rs/pull/10377, benchmarks=coalesce_kernels
   2026-09-20T22:17:57.296396Z  INFO benchmark_controller::runner::bench_arrow === Cloning PR branch ===
   2026-09-20T22:17:57.296566Z  INFO benchmark_controller::runner::shell running command cmd=git, args=["clone", "--depth=200", "https://github.com/apache/arrow-rs.git", "/workspace/arrow-rs-branch"], cwd="/"
   2026-09-20T22:18:02.339066Z  INFO benchmark_controller::runner::shell running command cmd=git, args=["fetch", "origin", "refs/pull/10377/head:issue-9298-concat-array-data", "main"], cwd="/workspace/arrow-rs-branch"
   2026-09-20T22:18:07.363668Z  INFO benchmark_controller::runner::shell running command cmd=git, args=["checkout", "issue-9298-concat-array-data"], cwd="/workspace/arrow-rs-branch"
   2026-09-20T22:18:12.365615Z  INFO benchmark_controller::runner::shell running command cmd=git, args=["submodule", "update", "--init"], cwd="/workspace/arrow-rs-branch"
   2026-09-20T22:18:17.367952Z  INFO benchmark_controller::runner::shell running command cmd=git, args=["merge-base", "HEAD", "origin/main"], cwd="/workspace/arrow-rs-branch"
   2026-09-20T22:18:22.369895Z  INFO benchmark_controller::runner::shell running command cmd=cargo, args=["update"], cwd="/workspace/arrow-rs-branch"
   2026-09-20T22:18:27.371574Z  INFO benchmark_controller::runner::bench_arrow === Cloning merge-base ===
   2026-09-20T22:18:27.371589Z  INFO benchmark_controller::runner::shell running command cmd=git, args=["clone", "--depth=200", "https://github.com/apache/arrow-rs.git", "/workspace/arrow-rs-base"], cwd="/"
   2026-09-20T22:18:32.374396Z  INFO benchmark_controller::runner::shell running command cmd=git, args=["-c", "advice.detachedHead=false", "checkout", "4cd8be954f6bc6b6dd265140207365b59a9900ec"], cwd="/workspace/arrow-rs-base"
   2026-09-20T22:18:37.376032Z  INFO benchmark_controller::runner::shell running command cmd=git, args=["submodule", "update", "--init"], cwd="/workspace/arrow-rs-base"
   2026-09-20T22:18:42.377909Z  INFO benchmark_controller::runner::shell running command cmd=cargo, args=["update"], cwd="/workspace/arrow-rs-base"
   2026-09-20T22:18:47.379706Z  INFO benchmark_controller::runner::shell running command cmd=rustc, args=["--version"], cwd="/"
   2026-09-20T22:18:52.406075Z  INFO benchmark_controller::runner::shell running command cmd=git, args=["rev-parse", "HEAD"], cwd="/workspace/arrow-rs-branch"
   2026-09-20T22:18:57.408156Z  INFO benchmark_controller::runner::shell running command cmd=git, args=["rev-parse", "HEAD"], cwd="/workspace/arrow-rs-base"
   2026-09-20T22:19:02.410870Z  INFO benchmark_controller::runner::controller_client post_comment _repo=apache/arrow-rs, _pr_number=10377, job_id=2534
   2026-09-20T22:19:03.195966Z  INFO benchmark_controller::runner::bench_arrow === Compiling PR branch and merge-base in parallel ===
   2026-09-20T22:19:46.027745Z  INFO benchmark_controller::runner::bench_arrow === Compilation complete ===
   2026-09-20T22:19:46.027758Z  INFO benchmark_controller::runner::bench_arrow === Running benchmark on merge-base ===
   2026-09-20T22:19:46.027777Z  INFO benchmark_controller::runner::shell running command (monitored) cmd=cargo, args=["bench", "--features=arrow,async,test_common,experimental,object_store", "--bench", "coalesce_kernels", "--", "--save-baseline", "main", "run_end"], cwd="/workspace/arrow-rs-base"
   2026-09-20T22:19:56.041532Z  INFO benchmark_controller::runner::bench_arrow === Running benchmark on PR branch ===
   2026-09-20T22:19:56.041550Z  INFO benchmark_controller::runner::shell running command (monitored) cmd=cargo, args=["bench", "--features=arrow,async,test_common,experimental,object_store", "--bench", "coalesce_kernels", "--", "--save-baseline", "issue-9298-concat-array-data", "run_end"], cwd="/workspace/arrow-rs-branch"
   2026-09-20T22:20:01.048495Z  INFO benchmark_controller::runner::shell running command cmd=critcmp, args=["main", "issue-9298-concat-array-data"], cwd="/workspace/arrow-rs-branch"
   2026-09-20T22:20:06.050618Z ERROR runner benchmark failed error=critcmp: critcmp main issue-9298-concat-array-data exited with code 1
   stdout:
   
   stderr:
   no criterion data exists at /workspace/arrow-rs-branch/target/criterion
   set a different target directory with --target-dir or set CARGO_TARGET_DIR
   ```
   
   </details>
   
   <details><summary>Kubernetes message</summary>
   
   ```
   Job has reached the specified backoff limit
   ```
   
   </details>
   
   ---
   [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [arrow-select] perf: Replace `ArrayData` with direct `Array` construction in concat [arrow-rs]

Posted by "Rich-T-kid (via GitHub)" <gi...@apache.org>.
Rich-T-kid commented on code in PR #10377:
URL: https://github.com/apache/arrow-rs/pull/10377#discussion_r4058272122


##########
arrow/benches/concatenate_kernel.rs:
##########
@@ -235,6 +235,21 @@ fn add_benchmark(c: &mut Criterion) {
             |b| b.iter(|| bench_concat_arrays(&array_refs)),
         );
     }
+
+    // (name, logical_len, physical_len, num_arrays)
+    for (name, logical, physical, n) in [
+        ("small logical=32 physical=4 x4", 32usize, 4usize, 4usize),
+        ("logical=1024 physical=128 x8", 1024, 128, 8),
+        ("logical=8192 physical=1024 x10", 8192, 1024, 10),
+    ] {
+        let arrays: Vec<RunArray<Int32Type>> = (0..n)
+            .map(|_| create_primitive_run_array::<Int32Type, Int32Type>(logical, physical))
+            .collect();
+        let array_refs: Vec<&dyn Array> = arrays.iter().map(|a| a as &dyn Array).collect();
+        c.bench_function(&format!("concat run i32 {name}"), |b| {
+            b.iter(|| bench_concat_arrays(&array_refs))
+        });
+    }

Review Comment:
   I think the perf wins should be self explanatory for this PR, but it seems that ree concatenate  benchmarks don't exist



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [arrow-select] perf: Replace `ArrayData` with direct `Array` construction in concat [arrow-rs]

Posted by "adriangbot (via GitHub)" <gi...@apache.org>.
adriangbot commented on PR #10377:
URL: https://github.com/apache/arrow-rs/pull/10377#issuecomment-5753189455

   🤖 Arrow criterion benchmark completed (GKE) | [trigger](https://github.com/apache/arrow-rs/pull/10377#issuecomment-5753129563)
   
   **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB)
   
   Comparing issue-9298-concat-array-data (3ce20877b014f45524420fbebd8f21dcb5b0dc3a) to 4cd8be9 (merge-base) [diff](https://github.com/apache/arrow-rs/compare/4cd8be954f6bc6b6dd265140207365b59a9900ec..3ce20877b014f45524420fbebd8f21dcb5b0dc3a)
   
   <details><summary>Run configuration</summary>
   
   ```yaml
   run benchmark concatenate_kernel
   ```
   
   </details>
   
   <details><summary>CPU Details (lscpu)</summary>
   
   ```
   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>
   
   <details><summary>Details</summary>
   <p>
   
   ```
   group                                                          issue-9298-concat-array-data           main
   -----                                                          ----------------------------           ----
   concat 1024 arrays boolean 4                                   1.00     11.0±0.27µs        ? ?/sec    1.00     11.0±0.22µs        ? ?/sec
   concat 1024 arrays i32 4                                       1.00      7.2±0.03µs        ? ?/sec    1.00      7.1±0.03µs        ? ?/sec
   concat 1024 arrays str 4                                       1.04     23.8±0.07µs        ? ?/sec    1.00     22.9±0.06µs        ? ?/sec
   concat boolean 1024                                            1.00    215.2±1.43ns        ? ?/sec    1.05    226.4±8.81ns        ? ?/sec
   concat boolean 8192 over 100 arrays                            1.00      3.8±0.06µs        ? ?/sec    1.02      3.9±0.06µs        ? ?/sec
   concat boolean nulls 1024                                      1.00    353.9±2.36ns        ? ?/sec    1.05   371.8±10.48ns        ? ?/sec
   concat boolean nulls 8192 over 100 arrays                      1.00      9.6±0.24µs        ? ?/sec    1.00      9.6±0.30µs        ? ?/sec
   concat fixed size lists                                        1.07   278.8±31.72µs        ? ?/sec    1.00   260.5±33.59µs        ? ?/sec
   concat i32 1024                                                1.00    311.7±1.79ns        ? ?/sec    1.00    310.1±1.75ns        ? ?/sec
   concat i32 8192 over 100 arrays                                1.00     93.2±0.89µs        ? ?/sec    1.14    106.1±0.76µs        ? ?/sec
   concat i32 nulls 1024                                          1.00    511.6±0.91ns        ? ?/sec    1.01    517.7±1.58ns        ? ?/sec
   concat i32 nulls 8192 over 100 arrays                          1.00    102.4±3.01µs        ? ?/sec    1.16    118.6±2.79µs        ? ?/sec
   concat run i32 logical=1024 physical=128 x8                    1.00      3.7±0.00µs        ? ?/sec  
   concat run i32 logical=8192 physical=1024 x10                  1.00     23.7±0.02µs        ? ?/sec  
   concat run i32 small logical=32 physical=4 x4                  1.00    915.2±5.05ns        ? ?/sec  
   concat str 1024                                                1.00      6.1±0.02µs        ? ?/sec    1.01      6.2±0.02µs        ? ?/sec
   concat str 8192 over 100 arrays                                1.00     50.3±0.99ms        ? ?/sec    1.03     51.7±0.86ms        ? ?/sec
   concat str nulls 1024                                          1.01      3.2±0.01µs        ? ?/sec    1.00      3.2±0.02µs        ? ?/sec
   concat str nulls 8192 over 100 arrays                          1.00     26.1±0.78ms        ? ?/sec    1.03     26.8±0.84ms        ? ?/sec
   concat str_dict 1024                                           1.02      2.1±0.01µs        ? ?/sec    1.00      2.1±0.02µs        ? ?/sec
   concat str_dict_sparse 1024                                    1.01      8.5±0.05µs        ? ?/sec    1.00      8.5±0.02µs        ? ?/sec
   concat struct with int32 and dicts size=1024 count=2           1.01      4.8±0.02µs        ? ?/sec    1.00      4.7±0.02µs        ? ?/sec
   concat utf8_view  max_str_len=128 null_density=0               1.00     58.4±0.10µs        ? ?/sec    1.00     58.5±0.16µs        ? ?/sec
   concat utf8_view  max_str_len=128 null_density=0.2             1.00     59.0±0.07µs        ? ?/sec    1.01     59.7±0.29µs        ? ?/sec
   concat utf8_view  max_str_len=20 null_density=0                1.00     58.5±0.08µs        ? ?/sec    1.00     58.4±0.12µs        ? ?/sec
   concat utf8_view  max_str_len=20 null_density=0.2              1.00     58.9±0.06µs        ? ?/sec    1.00     59.1±0.13µs        ? ?/sec
   concat utf8_view all_inline max_str_len=12 null_density=0      1.00     17.6±0.03µs        ? ?/sec    1.00     17.5±0.03µs        ? ?/sec
   concat utf8_view all_inline max_str_len=12 null_density=0.2    1.00     18.2±0.04µs        ? ?/sec    1.00     18.2±0.08µs        ? ?/sec
   ```
   
   </p>
   </details>
   
   <details><summary>Resource Usage</summary>
   
   **base (merge-base)**
   | Metric | Value |
   |--------|-------|
   | Wall time | 240.1s |
   | Peak memory | 305.7 MiB |
   | Avg memory | 26.8 MiB |
   | CPU user | 220.3s |
   | CPU sys | 15.6s |
   | Peak spill | 0 B |
   
   **branch**
   | Metric | Value |
   |--------|-------|
   | Wall time | 270.1s |
   | Peak memory | 325.5 MiB |
   | Avg memory | 31.3 MiB |
   | CPU user | 248.1s |
   | CPU sys | 19.2s |
   | Peak spill | 0 B |
   </details>
   
   
   ---
   [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [arrow-select] perf: Replace `ArrayData` with direct `Array` construction in concat [arrow-rs]

Posted by "adriangbot (via GitHub)" <gi...@apache.org>.
adriangbot commented on PR #10377:
URL: https://github.com/apache/arrow-rs/pull/10377#issuecomment-5753142772

   🤖 Arrow criterion benchmark running (GKE) | [trigger](https://github.com/apache/arrow-rs/pull/10377#issuecomment-5753129563)
   **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c5753129563-2535-gbgc5 6.12.94+ #1 SMP Tue Aug  4 08:44:15 UTC 2026 aarch64 GNU/Linux`
   <details><summary>CPU Details (lscpu)</summary>
   
   ```
   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>
   
   Comparing issue-9298-concat-array-data (3ce20877b014f45524420fbebd8f21dcb5b0dc3a) to 4cd8be9 (merge-base) [diff](https://github.com/apache/arrow-rs/compare/4cd8be954f6bc6b6dd265140207365b59a9900ec..3ce20877b014f45524420fbebd8f21dcb5b0dc3a)
   
   <details><summary>Run configuration</summary>
   
   ```yaml
   run benchmark concatenate_kernel
   ```
   
   </details>
   
   BENCH_COMMAND=cargo bench --features=arrow,async,test_common,experimental,object_store --bench concatenate_kernel
   Results will be posted here when complete
   
   ---
   [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [arrow-select] perf: Replace `ArrayData` with direct `Array` construction in concat [arrow-rs]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #10377:
URL: https://github.com/apache/arrow-rs/pull/10377


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [arrow-select] perf: Replace `ArrayData` with direct `Array` construction in concat [arrow-rs]

Posted by "liamzwbao (via GitHub)" <gi...@apache.org>.
liamzwbao commented on code in PR #10377:
URL: https://github.com/apache/arrow-rs/pull/10377#discussion_r4059371009


##########
arrow-select/src/concat.rs:
##########
@@ -1889,6 +1896,27 @@ mod tests {
         assert_eq!(&[10, 20, 30, 40], values.values());
     }
 
+    #[test]
+    fn test_concat_run_array_length_overflows_run_end_type() {
+        // 20_000 + 20_000 exceeds i16::MAX.
+        let array1 = RunArray::<Int16Type>::try_new(
+            &Int16Array::from(vec![20_000]),
+            &Int16Array::from(vec![1]),
+        )
+        .unwrap();
+        let array2 = RunArray::<Int16Type>::try_new(
+            &Int16Array::from(vec![20_000]),
+            &Int16Array::from(vec![2]),
+        )
+        .unwrap();
+
+        let err = concat(&[&array1, &array2]).unwrap_err();
+        assert!(
+            err.to_string().contains("overflows the run-end type"),
+            "expected a run-end overflow error, got: {err}"
+        );

Review Comment:
   I think `RunEndIndexOverflowError` makes sense but we need to fix the error description a bit. 
   
   The old doc said “index bigger than the array length,” while the other overflow errors (`DictionaryKeyOverflowError` or `OffsetOverflowError`) all mean the value doesn’t fit in the integer type, which is what’s happening here, so I feel like we should match it.
   
   Plus, this error wasn't used anywhere before this PR, so it's safe to change.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [arrow-select] perf: Replace `ArrayData` with direct `Array` construction in concat [arrow-rs]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #10377:
URL: https://github.com/apache/arrow-rs/pull/10377#issuecomment-5871823304

   Thanks @liamzwbao @Rich-T-kid and @Jefffrey 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [arrow-select] perf: Replace `ArrayData` with direct `Array` construction in concat [arrow-rs]

Posted by "Rich-T-kid (via GitHub)" <gi...@apache.org>.
Rich-T-kid commented on PR #10377:
URL: https://github.com/apache/arrow-rs/pull/10377#issuecomment-5753129563

   run benchmark concatenate_kernel
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [arrow-select] perf: Replace `ArrayData` with direct `Array` construction in concat [arrow-rs]

Posted by "liamzwbao (via GitHub)" <gi...@apache.org>.
liamzwbao commented on code in PR #10377:
URL: https://github.com/apache/arrow-rs/pull/10377#discussion_r4059379302


##########
arrow-select/src/take.rs:
##########
@@ -2094,18 +2093,12 @@ mod tests {
     #[test]
     fn test_take_bool_nullable_index() {
         // indices where the masked invalid elements would be out of bounds
-        let index_data = ArrayData::try_new(

Review Comment:
   I was hoping to clean up all of them, so we can actually remove the dependency of `arrow-data` for this crate.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [arrow-select] perf: Replace `ArrayData` with direct `Array` construction in concat [arrow-rs]

Posted by "liamzwbao (via GitHub)" <gi...@apache.org>.
liamzwbao commented on code in PR #10377:
URL: https://github.com/apache/arrow-rs/pull/10377#discussion_r3997011581


##########
arrow-select/src/concat.rs:
##########
@@ -430,6 +430,16 @@ where
         return Ok(new_empty_array(arrays[0].data_type()));
     }
 
+    // Reject lengths that do not fit in `R` before any `R::Native` arithmetic can wrap.
+    let total_len: usize = run_arrays.iter().map(|r| r.len()).sum();
+    if R::Native::from_usize(total_len).is_none() {
+        return Err(ArrowError::ComputeError(format!(
+            "Concatenating RunArrays results in a logical length of {total_len}, \
+             which overflows the run-end type {}",
+            R::DATA_TYPE
+        )));
+    }

Review Comment:
   This is necessary to fix the failure reproduced in the UT `test_concat_run_array_length_overflows_run_end_type`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [arrow-select] perf: Replace `ArrayData` with direct `Array` construction in concat [arrow-rs]

Posted by "Rich-T-kid (via GitHub)" <gi...@apache.org>.
Rich-T-kid commented on code in PR #10377:
URL: https://github.com/apache/arrow-rs/pull/10377#discussion_r4058338084


##########
arrow-select/src/concat.rs:
##########
@@ -1889,6 +1896,27 @@ mod tests {
         assert_eq!(&[10, 20, 30, 40], values.values());
     }
 
+    #[test]
+    fn test_concat_run_array_length_overflows_run_end_type() {
+        // 20_000 + 20_000 exceeds i16::MAX.
+        let array1 = RunArray::<Int16Type>::try_new(
+            &Int16Array::from(vec![20_000]),
+            &Int16Array::from(vec![1]),
+        )
+        .unwrap();
+        let array2 = RunArray::<Int16Type>::try_new(
+            &Int16Array::from(vec![20_000]),
+            &Int16Array::from(vec![2]),
+        )
+        .unwrap();
+
+        let err = concat(&[&array1, &array2]).unwrap_err();
+        assert!(
+            err.to_string().contains("overflows the run-end type"),
+            "expected a run-end overflow error, got: {err}"
+        );

Review Comment:
   I think it would be a good idea to just match on the specific error, I.E `arrow::computeError`.
   
   I would say [reeOverflow](https://docs.rs/arrow/latest/arrow/error/enum.ArrowError.html#variant.RunEndIndexOverflowError)  may make sense here but it looks slightly different



##########
arrow-select/src/take.rs:
##########
@@ -2094,18 +2093,12 @@ mod tests {
     #[test]
     fn test_take_bool_nullable_index() {
         // indices where the masked invalid elements would be out of bounds
-        let index_data = ArrayData::try_new(

Review Comment:
   I think the issue was referring to application code but this is also nice 😅 



##########
arrow-select/src/nullif.rs:
##########
@@ -578,31 +578,13 @@ mod tests {
 
     /// Returns a new BooleanArray with no null buffer
     fn remove_null_buffer(array: &BooleanArray) -> BooleanArray {
-        make_array(

Review Comment:
   👍 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [arrow-select] perf: Replace `ArrayData` with direct `Array` construction in concat [arrow-rs]

Posted by "Rich-T-kid (via GitHub)" <gi...@apache.org>.
Rich-T-kid commented on PR #10377:
URL: https://github.com/apache/arrow-rs/pull/10377#issuecomment-5753067585

   run benchmark coalesce_kernels
   env:
     BENCH_FILTER: run_end


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org