lidavidm commented on code in PR #13375:
URL: https://github.com/apache/arrow/pull/13375#discussion_r898201393
##########
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:
Ah…here I had thought the `allow_overwrite` was meant for the user not for
the internal implementation. Can't we factor out an explicit check instead of
relying on 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]