Repository navigation
Cross-language invocation Part 1: Java calling Python functions and actors - #4166
Conversation
|
Test FAILed. |
|
If we got the eternal bug https://issues.apache.org/jira/browse/ARROW-1692 resolved, we could pass data natively between Java arrow and python arrow :D |
There was a problem hiding this comment.
Since these args are all untyped, why not use Java varargs? The only caveat is that you'll have to move the creation options a bit earlier.
There was a problem hiding this comment.
yeah, varargs would look nicer. But I wanted to make the order aligned with the regular createActor.
There was a problem hiding this comment.
Oops, that's an internal hack. I'll remove it.
There was a problem hiding this comment.
I found the nullability of functionDescriptor / pyFuncDescriptor confusing. Consider having one type for both, and methods task.functionDescriptor.getLanguage() instead.
There was a problem hiding this comment.
Consider merging these two fields to avoid nulls.
There was a problem hiding this comment.
It's actually needed for the next PR (serializing handle with json and pass it to Python), forgot to remove it.
|
Can one of the admins verify this patch? |
1 similar comment
|
Can one of the admins verify this patch? |
|
@raulchen any follow-up here? Looks like there are some merge conflicts now. |
|
@ericl I rebased the PR and addressed your comments. |
|
Test PASSed. |
|
Test PASSed. |
|
Test PASSed. |
|
Test PASSed. |
|
CI failure is related, but I cannot reproduce it on my machine. Will check tomorrow. |
| /** | ||
| * Represents metadata of a Python function. | ||
| */ | ||
| public class PyFunctionDescriptor { |
There was a problem hiding this comment.
For the sake of a little more type safety, how about having both this and FunctionDescriptor extend the same interface or base class?
There was a problem hiding this comment.
Thanks, will change.
ericl
left a comment
There was a problem hiding this comment.
Looks good -- just one comment on having a common base class for a bit more type safety.
It would also be nice to add an example of Python->Java calls, if there is a use case for that.
|
Test FAILed. |
This reverts commit 1dcec80.
|
@ericl Python calling Java will be implemented in next PR. Although it's already doable with low-level api, I'd like to create a higher-level API for convenience in next PR. I haven't thought thoroughly about the API, it may be something like the following. Suggestions are welcome! |
|
Sounds good. I think the experimental syntax looks fine for an initial release; you could also try to wrap the actors to provide a bit more of a pythonic API. |
|
Test FAILed. |
|
Test FAILed. |
|
Test PASSed. |
What do these changes do?
Implements Java calling Python functions and actors.
Usage:
Note, currently arguments can only be raw binaries. And when putting a binary in object store, we use special metadata to indicate that the object is raw binary and doesn't need serialization/deserialization.
Not implemented in this PR:
Related issue number
#2576