def _merge_statistics(stats, s):
    """ Update `stats` with vaules in `s`
    """
    stats[-1]['total_byte_size'] += s['total_byte_size']
    stats[-1]['num-rows'] += s['num-rows']
    ncols = len(stats[-1]['columns'])
    ncols_n = len(s['columns'])
    if ncols != ncols_n:
        raise ValueError(f'Column count not equal ({ncols} vs {ncols_n})')
    for i in range(ncols):
        name = stats[-1]['columns'][i]['name']
        j = i
        for ii in range(ncols):
            if name == s['columns'][j]['name']:
                break
            if ii == ncols - 1:
                raise KeyError(f'Column statistics missing for {name}')
            j = (j + 1) % ncols
        min_n = s['columns'][j]['min']
        max_n = s['columns'][j]['max']
        null_count_n = s['columns'][j]['null_count']
        min_i = stats[-1]['columns'][i]['min']
        max_i = stats[-1]['columns'][i]['max']
        stats[-1]['columns'][i]['min'] = min(min_i, min_n)
        stats[-1]['columns'][i]['max'] = max(max_i, max_n)
        stats[-1]['columns'][i]['null_count'] += null_count_n
    return True
