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

[C++] Add a "coalesce" variadic scalar kernel

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 5.0.0
    • C++

    Description

      Add a variadic scalar compute kernel that works like the SQL coalesce function. It should take arbitrarily many inputs of the same or compatible types and process them row-wise, returning the first non-null value in each row, or returning null if there are no non-null values in the row. 

      For example, in the case of 3 integer-type input arrays, this would take inputs:

      Array<int32>         Array<int32>         Array<int32>
      [                    [                    [
        null,                2,                   3,
        4,                   null,                6,
        null,                null,                9,
        null                 null                 null
      ]                    ]                    ]
      

      and return output:

      Array<int32>
      [ 
        2,
        4,
        9,
        null
      ] 
      

      This should accept scalars and recycle their values.

      Attachments

        Issue Links

          Activity

            People

              lidavidm David Li
              icook Ian Cook
              Votes:
              0 Vote for this issue
              Watchers:
              5 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