Github user iyerr3 commented on a diff in the pull request:
https://github.com/apache/incubator-madlib/pull/69#discussion_r86900413
--- Diff: src/ports/postgres/modules/utilities/in_mem_group_control.py_in
---
@@ -54,9 +54,19 @@ class BaseState(object):
ret_states=None, **kwargs):
self.update(col_grp_key, col_grp_state, ret_states)
+ def get_last_state_value(self):
+ ## This function returns a 0 or 1, after looking at the last
+ ## element of the state array for each group.
+ ## This returns a 0, only if the last element of the state array
+ ## of every group is 0. If the value is non-zero even for a single
+ ## group, it returns a 1.
+ if any([value[-1] for value in self._state.itervalues()]):
+ return 1
+ return 0
+
def update(self, col_grp_key, col_grp_state, ret_states):
failed_grp_keys = []
- if ret_states is None:
+ if ret_states is None or len(ret_states) == 0:
--- End diff --
this is same as `if not ret_states`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---