def mapreduce(self, map_keys, reduce, prefilter=None, postfilter=None):
"""
map_keys: a list or tuple of column names
reduce: a dictionary of {name -> expression}. For example: {'people_num': {'$count': 'id'}}
prefilter: filter out rows before map phase
postfilter: filter out results after reduce phase
return: a list of RowData
"""
...
My idea is like this:
add a method mapreduce to the Table class: