vibhatha commented on code in PR #13344:
URL: https://github.com/apache/arrow/pull/13344#discussion_r899043400


##########
cpp/src/arrow/compute/exec/aggregate.cc:
##########
@@ -61,7 +61,11 @@ Result<std::vector<std::unique_ptr<KernelState>>> 
InitKernels(
       // use known default options for the named function if possible
       auto maybe_function = 
ctx->func_registry()->GetFunction(aggregates[i].function);
       if (maybe_function.ok()) {
-        options = maybe_function.ValueOrDie()->default_options();
+        auto default_opts = maybe_function.ValueOrDie()->default_options();
+        // only update the options if the default options are set
+        if (default_opts != nullptr) {
+          options = default_opts->Copy();
+        }

Review Comment:
   Good one, I forgot the recent discussion on auto. 



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