You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Deduplicate Concat string and binary builders in datafusion-functions #26304
Both contain an offset-based builder and a view builder. The with_capacity, append_offset and finish bodies and the 7-arm ColumnarValueRef match in write differ only in the target array type, a UTF-8 check on scalars, and .as_bytes() on string values. The view builders' append_offset (make_view, the 12-byte inline threshold and the u32 offset overflow check) is identical in both, so any fix to the view layout logic has to be made twice.
Describe the solution you'd like
Introduce one byte-oriented builder parameterised over the output array type (a small trait providing the data type, the final array construction, and a scalar-validation hook).
Add a helper on ColumnarValueRef such as value_bytes(i) -> Option<&[u8]> so the 7-arm match collapses to one call.
Share the view-append logic between ConcatBinaryViewBuilder and ConcatStringViewBuilder, keeping only the type-specific finish() and its SAFETY comments separate.
Describe alternatives you've considered
Share only the view-builder append_offset, which is the most delicate duplicated piece.
Activity
refactor: deduplicate `concat` string and binary builders (apache#26318)