niyue commented on code in PR #38873:
URL: https://github.com/apache/arrow/pull/38873#discussion_r1408790026
##########
cpp/src/gandiva/random_generator_holder.cc:
##########
@@ -19,14 +19,13 @@
#include "gandiva/node.h"
namespace gandiva {
-Status RandomGeneratorHolder::Make(const FunctionNode& node,
- std::shared_ptr<RandomGeneratorHolder>*
holder) {
+Result<std::shared_ptr<RandomGeneratorHolder>> RandomGeneratorHolder::Make(
+ const FunctionNode& node) {
ARROW_RETURN_IF(node.children().size() > 1,
Status::Invalid("'random' function requires at most one
parameter"));
if (node.children().size() == 0) {
- *holder = std::shared_ptr<RandomGeneratorHolder>(new
RandomGeneratorHolder());
- return Status::OK();
+ return std::shared_ptr<RandomGeneratorHolder>(new RandomGeneratorHolder());
Review Comment:
This is not possible since this is called inside a factory function `Make`
and the constructor is intentionally marked as `private` so that users can only
use the factory function for creating instances, and `make_shared` can only
call public constructor.
--
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]