edponce commented on a change in pull request #11882:
URL: https://github.com/apache/arrow/pull/11882#discussion_r786359948



##########
File path: cpp/src/arrow/compute/kernels/scalar_compare.cc
##########
@@ -156,39 +212,52 @@ struct Maximum {
   }
 };
 
+// Check if timestamp timezones are comparable (either all are empty or none 
is).
+Status CheckCompareTimestamps(const ExecBatch& batch) {
+  if (batch.num_values() > 0) {
+    for (int i = 0; i < batch.num_values() - 1; ++i) {
+      const auto& tsi = checked_cast<const TimestampType&>(*batch[i].type());
+      for (int j = i + 1; j < batch.num_values(); ++j) {

Review comment:
       This check can be done with a linear search, comparing pairs as @pitrou 
pointed out. No need to do an all-to-all comparisons. I missed this when doing 
the change.

##########
File path: cpp/src/arrow/compute/kernels/codegen_internal.h
##########
@@ -1134,8 +1340,43 @@ ArrayKernelExec 
GeneratePhysicalInteger(detail::GetTypeId get_id) {
   }
 }
 
-template <template <typename... Args> class Generator, typename... Args>
+template <template <typename... Args> class Generator, typename Type0, 
typename... Args>
 ArrayKernelExec GeneratePhysicalNumeric(detail::GetTypeId get_id) {

Review comment:
       Maybe something like:
   ```c++
   // Generate a kernel given a templated functor for numeric types.
   // The functor is expected to have a constant output type specified via its 
first template parameter.
   GeneratePhysicalNumeric()
   
   // Generate a kernel given a templated functor for numeric types.
   // The functor is expected to have the same input and output numeric types.
   GeneratePhysicalNumericToNumeric()
   ```




-- 
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]


Reply via email to