wesm commented on code in PR #13654:
URL: https://github.com/apache/arrow/pull/13654#discussion_r925617294
##########
cpp/src/arrow/compute/kernels/scalar_compare.cc:
##########
@@ -171,22 +343,28 @@ struct CompareTimestamps
"Cannot compare timestamp with timezone to timestamp without
timezone, got: ",
lhs, " and ", rhs);
}
- return Base::Exec(ctx, batch, out);
+ return CompareKernel<Int64Type>::Exec(ctx, batch, out);
}
};
template <typename Op>
-void AddIntegerCompare(const std::shared_ptr<DataType>& ty, ScalarFunction*
func) {
- auto exec =
- GeneratePhysicalInteger<applicator::ScalarBinaryEqualTypes, BooleanType,
Op>(*ty);
- DCHECK_OK(func->AddKernel({ty, ty}, boolean(), std::move(exec)));
+ScalarKernel GetCompareKernel(InputType ty, Type::type compare_type,
+ ArrayKernelExec exec) {
+ ScalarKernel kernel;
+ kernel.signature = KernelSignature::Make({ty, ty}, boolean());
+ BinaryKernel func_aa = GetBinaryKernel<ComparePrimitive, Op>(compare_type);
+ BinaryKernel func_sa = GetBinaryKernel<ComparePrimitiveSA, Op>(compare_type);
+ BinaryKernel func_as = GetBinaryKernel<ComparePrimitiveAS, Op>(compare_type);
+ kernel.data = std::make_shared<CompareData>(func_aa, func_sa, func_as);
Review Comment:
`CompareKernel<T>` doesn't have the operator template, though, so if we
added operator as an additional template parameter, it would result in more
code being generated. I did this so we could reuse the "invoker" template (and
maybe probably move it to codegen_internal.h at some point)
--
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]