You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Rich-T-kid (via GitHub)" <gi...@apache.org> on 2026/09/16 20:55:41 UTC

[I] [coalesce] Implement specialized InProgressMapArray for BatchCoalescer [arrow-rs]

Rich-T-kid opened a new issue, #11116:
URL: https://github.com/apache/arrow-rs/issues/11116

   **Is your feature request related to a problem or challenge?**
   
   Part of https://github.com/apache/arrow-rs/issues/7761
   
   `MapArray` goes through `GenericInProgressArray` → `concat_maps`. A MapArray is structurally identical to `List<Struct<key, value>>` — it has an offset buffer and an entries `StructArray` child. A specialized implementation mirrors the proposed `InProgressListArray` (see the companion List issue) but with the entries child dispatched to `InProgressStructArray`.
   
   **Describe the solution you'd like**
   
   ```rust
   pub(crate) struct InProgressMapArray {
       entries_field: FieldRef,
       ordered: bool,
       source: Option<ArrayRef>,
       batch_size: usize,
       nulls: NullBufferBuilder,
       offsets: Vec<i32>,  // Map always uses i32 offsets
       entries: InProgressStructArray,  // entries is always a StructArray
   }
   ```
   
   **Implementation ideas:**
   
   1. **Reuse `InProgressListArray` logic**: the offset accumulation for Map is identical to `List<i32>` — factor out a common `InProgressOffsetArray` trait or helper
   2. **Entries specialization**: the entries child is always a `StructArray` with key and value fields; use `InProgressStructArray` for the entries, which recursively specializes key and value fields
   3. **Combined benefit**: a `Map<Utf8, Int64>` gets:
      - Incremental i32 offsets (vs. scan-then-reconstruct in `concat_maps`)
      - Entries struct with `InProgressPrimitiveArray` for the Int64 values
      - Keys as Utf8 (through GenericInProgressArray for now, or specialized if List PR lands)
   
   **`create_in_progress_array` dispatch:**
   
   ```rust
   DataType::Map(field, ordered) => {
       // entries field is always a StructArray containing key+value fields
       Box::new(InProgressMapArray::new(Arc::clone(field), *ordered, batch_size))
   }
   ```
   
   **Benchmarks**
   
   ```
   cargo bench --bench coalesce_kernels --features test_utils -- map
   ```


-- 
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.apache.org

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


Re: [I] [coalesce] Implement specialized InProgressMapArray for BatchCoalescer [arrow-rs]

Posted by "Rich-T-kid (via GitHub)" <gi...@apache.org>.
Rich-T-kid commented on issue #11116:
URL: https://github.com/apache/arrow-rs/issues/11116#issuecomment-5704705091

   these issues were made by accident after I told claude to investigate speed ups for type specific implementations for batchCoaclers. Did not expect it to have access to my github account  
   
   sorry about that


-- 
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: [I] [coalesce] Implement specialized InProgressMapArray for BatchCoalescer [arrow-rs]

Posted by "Rich-T-kid (via GitHub)" <gi...@apache.org>.
Rich-T-kid closed issue #11116: [coalesce] Implement specialized InProgressMapArray for BatchCoalescer
URL: https://github.com/apache/arrow-rs/issues/11116


-- 
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