You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "andygrove (via GitHub)" <gi...@apache.org> on 2026/10/14 13:55:50 UTC

[I] Extract shared list-array construction from the split_* functions in split.rs [datafusion-comet]

andygrove opened a new issue, #6983:
URL: https://github.com/apache/datafusion-comet/issues/6983

   ### What is the problem the feature request solves?
   
   In `native/spark-expr/src/string_funcs/split.rs`, the four generic split functions end with the same block of code: finish the values builder, pick `Utf8`/`LargeUtf8` from `O::IS_LARGE`, build the `item` field, and construct a `GenericListArray` with the offsets.
   
   - [L305-L327](https://github.com/apache/datafusion-comet/blob/7d8d9b1544b734c85a93cca2cc9d5380ad70accd/native/spark-expr/src/string_funcs/split.rs#L305-L327) (regex scalar)
   - [L338-L360](https://github.com/apache/datafusion-comet/blob/7d8d9b1544b734c85a93cca2cc9d5380ad70accd/native/spark-expr/src/string_funcs/split.rs#L338-L360) (`split_sql_generic_scalar`)
   - [L374-L397](https://github.com/apache/datafusion-comet/blob/7d8d9b1544b734c85a93cca2cc9d5380ad70accd/native/spark-expr/src/string_funcs/split.rs#L374-L397) (`split_sql_generic_scalar_array`)
   - [L415-L441](https://github.com/apache/datafusion-comet/blob/7d8d9b1544b734c85a93cca2cc9d5380ad70accd/native/spark-expr/src/string_funcs/split.rs#L415-L441) (`split_sql_generic_array`)
   
   They differ only in the per-row call and in how the null buffer is produced (cloned input nulls vs `NullBufferBuilder`). A fix to the list construction, such as the item field's nullability, has to be made in four places.
   
   ### Describe the potential solution
   
   Extract `fn finish_split_list<O: OffsetSizeTrait>(offsets: Vec<O>, values: GenericStringBuilder<O>, nulls: Option<NullBuffer>) -> ColumnarValue` and call it from all four functions. Optionally, also factor the per-row loop into a generic driver so each variant only supplies its null predicate and push call.
   
   ### Additional context
   
   This is small and a good first issue. Line references are pinned to commit 7d8d9b1544b7.
   


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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Extract shared list-array construction from the split_* functions in split.rs [datafusion-comet]

Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove closed issue #6983: Extract shared list-array construction from the split_* functions in split.rs
URL: https://github.com/apache/datafusion-comet/issues/6983


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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org