cpp/src/arrow/dataset/expression.cc
// Conjunction members which are represented in known_values are erased from
// conjunction_members
Conjunction members which are represented in known_values are erased from
conjunction_members
Conjunction members which are represented in known_values are erased from conjunction_members
Status ExtractKnownFieldValuesImpl(
    std::vector<Expression>* conjunction_members,
    std::unordered_map<FieldRef, Datum, FieldRef::Hash>* known_values) {
  auto unconsumed_end =
      std::partition(conjunction_members->begin(), conjunction_members->end(),
                     [](const Expression& expr) {
                       auto call = expr.call();
                       if (!call) return true;
                       if (call->function_name == "equal") {
                         auto ref = call->arguments[0].field_ref();
                         auto lit = call->arguments[1].literal();
                         return !(ref && lit);
                       }
                       return true;
                     });
  for (auto it = unconsumed_end; it != conjunction_members->end(); ++it) {
    auto call = CallNotNull(*it);
    auto ref = call->arguments[0].field_ref();
    auto lit = call->arguments[1].literal();
    known_values->emplace(*ref, *lit);
  }
  conjunction_members->erase(unconsumed_end, conjunction_members->end());
  return Status::OK();
}
Status ExtractKnownFieldValuesImpl ( std :: vector < Expression > * conjunction_members , std :: unordered_map < FieldRef , Datum , FieldRef :: Hash > * known_values ) { auto unconsumed_end = std :: partition ( conjunction_members -> begin ( ) , conjunction_members -> end ( ) , [ ] ( const Expression & expr ) { auto call = expr . call ( ) ; if ( ! call ) return true ; if ( call -> function_name == " " ) { auto ref = call -> arguments [ 0 ] . field_ref ( ) ; auto lit = call -> arguments [ 1 ] . literal ( ) ; return ! ( ref && lit ) ; } return true ; } ) ; for ( auto it = unconsumed_end ; it != conjunction_members -> end ( ) ; ++ it ) { auto call = CallNotNull ( * it ) ; auto ref = call -> arguments [ 0 ] . field_ref ( ) ; auto lit = call -> arguments [ 1 ] . literal ( ) ; known_values -> emplace ( * ref , * lit ) ; } conjunction_members -> erase ( unconsumed_end , conjunction_members -> end ( ) ) ; return Status :: OK ( ) ; }
Conjunction members which are represented in known_values are erased from
conjunction_members
Conjunction members which are represented in known_values are erased from conjunction_members
// search for an equality conditions between a field and a literal