mapleFU commented on code in PR #37100:
URL: https://github.com/apache/arrow/pull/37100#discussion_r1291517740


##########
cpp/src/arrow/compute/kernels/aggregate_basic.cc:
##########
@@ -873,6 +888,13 @@ Result<TypeHolder> MinMaxType(KernelContext*, const 
std::vector<TypeHolder>& typ
   return struct_({field("min", ty), field("max", ty)});
 }
 
+Result<TypeHolder> DictionaryMinMaxType(KernelContext*, const 
std::vector<TypeHolder>& types) {
+  // T -> struct<min: T.value_type, max: T.value_type>
+  auto ty = types.front().GetSharedPtr();

Review Comment:
   Hi, `MinMaxType` would copy the `shared_ptr`, so it calls `GetSharedPtr`. 
But here seems that we only gets the child type? Can we just:
   
   ```
   Result<TypeHolder> DictionaryMinMaxType(KernelContext*, const 
std::vector<TypeHolder>& types) {
     // T -> struct<min: T.value_type, max: T.value_type>
     const auto& ty = types.front();
     const DictionaryType& ty_dict = checked_cast<const DictionaryType&>(*ty);
   ```
   
   ?



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