rtpsw commented on code in PR #13252:
URL: https://github.com/apache/arrow/pull/13252#discussion_r893315827
##########
cpp/src/arrow/compute/registry.cc:
##########
@@ -115,20 +181,47 @@ std::unique_ptr<FunctionRegistry>
FunctionRegistry::Make() {
return std::unique_ptr<FunctionRegistry>(new FunctionRegistry());
}
-FunctionRegistry::FunctionRegistry() { impl_.reset(new
FunctionRegistryImpl()); }
+std::unique_ptr<FunctionRegistry> FunctionRegistry::Make(FunctionRegistry*
parent) {
+ return std::unique_ptr<FunctionRegistry>(
+ new FunctionRegistry(new
FunctionRegistry::FunctionRegistryImpl(&*parent->impl_)));
Review Comment:
This change leads to a failed test:
```
/mnt/user1/tscontract/github/rtpsw/arrow/cpp/src/arrow/compute/registry_test.cc:124:
Failure
Failed
'default_registry->CanAddFunction(func)' failed with Key error: Already have
a function registered with name: f1
[ FAILED ] TestRegistry.RegisterTempFunctions (0 ms)
```
The existing code makes a new `FunctionRegistryImpl` with a parent of the
same type, which is what we want for scoping. Though I did fix this code to use
`.get()`.
--
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]