Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-5588

[C++] Better support for building UnionArrays

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.15.0
    • Component/s: C++

      Description

      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).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bkietz Ben Kietzman
                Reporter:
                bkietz Ben Kietzman
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 3h 50m
                  3h 50m