I have a fancy Python script running in my PythonCaller, but I want to use a "Group By" logic to process my features. I'd rather not have to manually split my features and plop down a PythonCaller for each separate stream. Is there an easy way to do this within the Python script? Or any way??
Page 1 / 1
There seem to be two ways to use "Group By" logic with a PythonCaller.
1) Wrap your PythonCaller in a custom transformer and harness the power of the "Parallel Process By" advanced parameter. See this post for more details.
2) Use the PythonCaller class template and build a dictionary in the input method. The dictionary keys will become unique groups, while the values for each key will contain a list of features belonging to the group. With this method, most of your processing will have to take place in the close method, after looping through each key in the dictionary and/or each list of features mapped to each key.
Take a look at the sample script for more details!
Also don't forget to head over and vote on this idea, or post your own PythonCaller wishlist!