Is there a way to get filter out of Arrow::Array and some predicate?

  apache-arrow, c++

Assume that I have an Arrow::Array (or Dataframe or ChunkedArray, not important) and I have some predicate. I want to compute a new Arrow::BooleanArray which just stores result of this predicate applied to each of the array element.

My case is that I have two sorted arrays of date32 and I want to return a mask which tells me if the value of the first array is present in the second. Like the following:

std::shared_ptr<arrow::BooleanArray> getDatesMask(
    const std::shared_ptr<arrow::Array>& lhs,
    const std::shared_ptr<arrow::Array>& lhs) 
{
   // some pseudo code how this could work
   // for date in lhs:
   //     res.Append(date in rhs);
   // return res;
}

Source: Windows Questions C++

LEAVE A COMMENT