Commits


Matthijs Brobbel authored and Benjamin Kietzman committed a93c493c67e
ARROW-4975: [C++] Support concatenation of UnionArrays This PR adds support for concatenation of union arrays. For sparse union arrays this is trivial: the type buffers and child arrays are concatenated like the other concatenate implementations. For dense union arrays the following approach is used: - The type buffers are concatenated. - The child arrays are concatenated, but slicing is ignored. This makes building the offsets buffer more simple. - For every input array the length of the different child arrays (concatenated up to that point) is tracked. By iterating over the types buffers these offsets can be applied to the values in the concatenated offsets buffer. Does this make sense or should we slice child arrays (when required) and reflect this in the concatenated offsets buffer? This PR also removes a check in `DenseUnionArray::Make` that rejected empty offsets buffers. This made it impossible to construct empty dense union arrays. I discussed removing this check with @bkietz. Closes #11843 from mbrobbel/arrow-4975 Authored-by: Matthijs Brobbel <m1brobbel@gmail.com> Signed-off-by: Benjamin Kietzman <bengilgit@gmail.com>