rtpsw commented on pull request #12338:
URL: https://github.com/apache/arrow/pull/12338#issuecomment-1044517457


   > Right, I think here:
   > 
   > 
https://github.com/apache/arrow/blob/26d6e6217ff79451a3fe366bcc88293c7ae67417/cpp/src/arrow/compute/kernels/scalar_compare.cc#L361
   > 
   > We can basically check if `batch.num_values() == 2` and if so, delegate to 
ScalarBinaryEqualTypes.
   
   I'm not sure what code you meant. I tried the following:
   ```
       if (batch.num_values() == 2) {
         return ExecBinaryMinMaxScalar::Exec(ctx, options, batch, out);
       }
   ```
   Unfortunately, this led to a large number of complaints form the compiler, 
e.g., for `struct Minimum`.
   
   Then, I tried the following:
   ```
     static Status Exec(KernelContext* ctx, const ExecBatch& batch, Datum* out) 
{
       const ElementWiseAggregateOptions& options = MinMaxState::Get(ctx);
       if (batch.num_values() == 2) {
         return ExecBinaryMinMaxScalar<Op>(ctx, options, batch, out);
       }
   ```
   This compiles but, unfortunately, then `arrow-compute-scalar-test` fails 
with a segmentation fault at TestVarArgsCompareNumeric/0, where TypeParam = 
arrow::UInt8Type".
   
   I don't know enough to predict the impact of such a change even if made to 
work. I tend to say it is out of scope for this issue.


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