Skip to content

[C++] Better support for building UnionArrays #22029

@asfimport

Description

@asfimport

UnionBuilders (for both sparse and dense mode unions) are not currently supported by MakeBuilder or ArrayFromJSON. This increases friction when working with and testing against union arrays, and support should be added to both. For ArrayFromJSON each entry must be specified with a (type code, value) pair:

ArrayFromJSON(union_({field("lint", list(int32())), field("str", utf8())}), R"([
  [0, null],
  [1, "hello"],
  [0, [1, 2]],
  [1, "world"]
])");

DenseUnionBuilder currently requires the user to explicitly input offsets, but if it were modified to hold pointers to child builders (as ListBuilder, for example) then those offsets could be derived from the lengths of child builders (which is much more user friendly).

Reporter: Ben Kietzman / @bkietz
Assignee: Ben Kietzman / @bkietz

Related issues:

PRs and other links:

Note: This issue was originally created as ARROW-5588. Please see the migration documentation for further details.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions