-
Notifications
You must be signed in to change notification settings - Fork 46
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
Modify Python UDF types for RACO compatibility #885
Comments
Does an aggregate ever actually need to be passed an input state, or does it just output a state (assuming that the Python worker is always passed all the tuples associated with the state it is computing, in a single batch)? |
You're probably right, assuming that @parmitam isn't using any of the state initialization logic for anything meaningful. |
Is it possible to just infer the flatmap UDF case by examining the value returned during each invocation? E.g.: result = udf(tuple)
if isinstance(result, list):
do_flatmap_stuff(result)
elif isinstance(result, tuple):
do_apply_stuff(result)
else:
raise SomeException() |
not really. |
Also, state initializing logic just initialized the state variable, which is then passed to the python udf as part of the input tuple. So we'd have input tuple -> output tuple ( apply); input tuple-> multiple tuples(flatmap); input tuplebatch->output tuple( agg) |
I don't quite understand what is meant by "the state variable...is then passed to the python udf as part of the input tuple". For aggregates, isn't the state always a single tuple, distinct from the input tuples that belong to the aggregate group? |
uda foo(img){ T1 = SCAN(Images); tuple passed to pySum is (_val, img) where _val=null; and output is _val ( which is whatever pySum returns) tuple sent to pyMean is (_val, _a) |
Oh, maybe the confusion here is that there is only one input tuple in each |
We discussed modifying the Python UDF functionality in the following ways:
The text was updated successfully, but these errors were encountered: