def dict2Multiset(dic): if dic == None: return None from mo_collections.multiset import Multiset output = Multiset() output.dic = unwrap(dic).copy() return output
class Min(WindowFunction): def __init__(self, **kwargs): object.__init__(self) self.total = Multiset() def add(self, value): if value == None: return self.total.add(value) def sub(self, value): if value == None: return self.total.remove(value) def end(self): return MIN(self.total)
def __init__(self, **kwargs): object.__init__(self) self.total = Multiset()