edponce commented on a change in pull request #11882:
URL: https://github.com/apache/arrow/pull/11882#discussion_r782572785
##########
File path: cpp/src/arrow/compute/api_scalar.h
##########
@@ -316,6 +316,21 @@ struct ARROW_EXPORT CompareOptions {
enum CompareOperator op;
};
+enum class BetweenMode : int8_t {
+ LESS_EQUAL_LESS_EQUAL,
+ LESS_EQUAL_LESS,
+ LESS_LESS_EQUAL,
+ LESS_LESS,
+};
Review comment:
Yes, I agree with @lidavidm on how the BetweenOptions should be
organized.
Sorry for suggesting a similar approach as in `RoundOptions` but that was a
special case where different but similar kernels with function-specific options
needed to share an enum.
##########
File path: cpp/src/arrow/compute/kernels/scalar_compare_benchmark.cc
##########
@@ -77,5 +77,44 @@ BENCHMARK(GreaterArrayScalarInt64)->Apply(RegressionSetArgs);
BENCHMARK(GreaterArrayArrayString)->Apply(RegressionSetArgs);
BENCHMARK(GreaterArrayScalarString)->Apply(RegressionSetArgs);
+template <typename Type>
+static void BetweenScalarArrayScalar(benchmark::State& state) {
+ RegressionArgs args(state, /*size_is_bytes=*/false);
+ auto ty = TypeTraits<Type>::type_singleton();
+ auto rand = random::RandomArrayGenerator(kSeed);
+ auto array = rand.ArrayOf(ty, args.size, args.null_proportion);
+ auto scalar_left = *rand.ArrayOf(ty, 1, 0)->GetScalar(0);
+ auto scalar_right = *rand.ArrayOf(ty, 1, 0)->GetScalar(0);
+ for (auto _ : state) {
+ ABORT_NOT_OK(
+ CallFunction("between_less_equal_less_equal", {array, scalar_left,
scalar_right})
+ .status());
Review comment:
Function is not called "between"
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]