-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Go] Compute package closed to adding custom functions. #36936
Comments
@zeroshade I hope you don't mind the direct tag, but I've seen your name in most of the compute packages commits, would you be able to help me here? |
Hey @cube2222 no worries about the tag! So, part of disallowing the external custom functions like that was just overlooking it as the interface grew and expanded while trying to keep people from shooting themselves in the foot. Another part of it was to try to encourage people to contribute functions back to the repo, lol. But you're right, I should make the top level interfaces like |
Hah, I guess that makes sense @zeroshade! Thanks for the explanation. Not sure if you have any specific vision on what should and what should not be exported, but based on the structures and interfaces required to register a function, it seems that it makes sense to just make the whole In case that makes sense, here's a PR #36959, but no hard feelings if you prefer to approach it differently. With this change registering functions from "userspace" works like a charm. Quick example:
works as expected. All tests pass too. |
I think that's a fine solution, ideally I shouldn't have to make many changes to the current structure of those interfaces and If I do they are interfaces which should be easy to use without breaking. Hopefully I don't regret this statement in the future 😆 |
### Rationale for this change As discussed in the issue #36936 , this change makes it possible for the consumers of the module to register custom functions, while taking advantage of the existing infrastructure for matching types and choosing kernels. ### What changes are included in this PR? Just moving the package one level higher, so that it's module-exported. ### Are these changes tested? There's no actual code changes other than moving files around and updating imports - existing tests still pass. ### Are there any user-facing changes? The `compute/exec` is now exported. * Closes: #36936 Authored-by: Jakub Martin <jakub.wit.martin@gmail.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>
…pache#36959) ### Rationale for this change As discussed in the issue apache#36936 , this change makes it possible for the consumers of the module to register custom functions, while taking advantage of the existing infrastructure for matching types and choosing kernels. ### What changes are included in this PR? Just moving the package one level higher, so that it's module-exported. ### Are these changes tested? There's no actual code changes other than moving files around and updating imports - existing tests still pass. ### Are there any user-facing changes? The `compute/exec` is now exported. * Closes: apache#36936 Authored-by: Jakub Martin <jakub.wit.martin@gmail.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>
Describe the usage question you have. Please include as many useful details as possible.
Hey!
I've tried to use the Go arrow module, specifically the compute package. It contains some handy "infrastructure" for defining functions, kernels for them, matching the right kernels to the type, etc.
However, it seems like adding custom functions to a FunctionRegistry as a consumer of the module is impossible?
Implementing the Function interface requires returning an exec.Kernel - which is a struct from the internal
arrow/compute/internal/kernels
package, so that's impossible. Same goes for reusing existing utility structures, like the ScalarFunction.Could you please explain the reason for the API disallowing custom functions (or, probably, showing me what I'm missing to define custom functions)? Thanks a lot in advance!
Component(s)
Go
The text was updated successfully, but these errors were encountered: