MCPcopy Create free account
hub / github.com/apache/arrow / GetComparator

Function GetComparator

cpp/src/arrow/compute/kernels/vector_selection_test.cc:468–484  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

466
467template <typename CType>
468Comparator<CType>* GetComparator(CompareOperator op) {
469 static Comparator<CType>* cmp[] = {
470 // EQUAL
471 [](CType l, CType r) { return l == r; },
472 // NOT_EQUAL
473 [](CType l, CType r) { return l != r; },
474 // GREATER
475 [](CType l, CType r) { return l > r; },
476 // GREATER_EQUAL
477 [](CType l, CType r) { return l >= r; },
478 // LESS
479 [](CType l, CType r) { return l < r; },
480 // LESS_EQUAL
481 [](CType l, CType r) { return l <= r; },
482 };
483 return cmp[op];
484}
485
486template <typename T, typename Fn, typename CType = typename TypeTraits<T>::CType>
487std::shared_ptr<Array> CompareAndFilter(const CType* data, int64_t length, Fn&& fn) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected