rtpsw commented on code in PR #13375:
URL: https://github.com/apache/arrow/pull/13375#discussion_r898200017


##########
cpp/src/arrow/compute/registry.h:
##########
@@ -47,35 +47,64 @@ class ARROW_EXPORT FunctionRegistry {
  public:
   ~FunctionRegistry();
 
-  /// \brief Construct a new registry. Most users only need to use the global
-  /// registry
+  /// \brief Construct a new registry.
+  ///
+  /// Most users only need to use the global registry.
   static std::unique_ptr<FunctionRegistry> Make();
 
-  /// \brief Add a new function to the registry. Returns Status::KeyError if a
-  /// function with the same name is already registered
+  /// \brief Construct a new nested registry with the given parent.
+  ///
+  /// Most users only need to use the global registry. The returned registry 
never changes
+  /// its parent, even when an operation allows overwritting.
+  static std::unique_ptr<FunctionRegistry> Make(FunctionRegistry* parent);
+
+  /// \brief Check whether a new function can be added to the registry.
+  ///
+  /// \returns Status::KeyError if a function with the same name is already 
registered.
+  Status CanAddFunction(std::shared_ptr<Function> function, bool 
allow_overwrite = false);

Review Comment:
   `DoAddFunction` either does the addition or dry-runs it, depending on the 
Boolean flag argument. I guess `Do` isn't ideal to describe this (yet I can't 
think of a better name) but `Try` would not be right. This dry-run behavior is 
why `CanAddFunction` and `AddFunction` are both implemented using a common 
function and differ only by the value of a flag.



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