Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yes, when you aggregate the group's values, you can have non-deterministic behaviors. Operations like "calculate an even number" can be non-deterministic, but other operations like "give me the group average" (which is what the post proposes) are deterministic.

Anecdote time: some weeks ago I had a bug for this reason. I was doing a groupby + select the first element, and since the first element is not always the same I was getting some weird results. I solved it by sorting the group elements before selecting the first element.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: