pratyushadk opened a new pull request, #50880:
URL: https://github.com/apache/arrow/pull/50880

   ### Rationale for this change
   
   Currently, the `replace_with_mask` compute kernel throws a `NotImplemented` 
error when called on variable-width list arrays (`ListType` and 
`LargeListType`). Given that this function is widely used for data 
manipulation, supporting list arrays natively is a highly requested enhancement.
   
   ### What changes are included in this PR?
   
   This PR introduces variable-width list support to the `replace_with_mask` 
kernel.
   * Modified the primary `ReplaceMaskImpl` template condition to exclude 
variable-length list types to resolve MSVC compilation ambiguities.
   * Implemented a specialized `ReplaceMaskImpl` for `ListType` and 
`LargeListType`. It safely iterates through values and uses `ListBuilder` / 
`LargeListBuilder` to append array slices of the child arrays, handling nulls 
without directly mutating array offsets.
   * Registered the `List` and `LargeList` types to the `replace_with_mask` 
function registry (excluding `fill_null` functions which do not yet support 
lists).
   
   ### Are these changes tested?
   
   Yes. Extensive C++ unit tests were added in `vector_replace_test.cc` for 
both `ListType` and `LargeListType`. The test suites cover scalar vs. array 
masks, null mask entries, empty lists, mismatched replacement lengths, and 
chunked arrays. All tests pass locally on Windows MSVC.
   
   ### Are there any user-facing changes?
   
   Yes. Users can now pass `ListArray` and `LargeListArray` types to 
`replace_with_mask` without encountering a `NotImplemented` error. There are no 
breaking changes to existing public APIs.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to