a = A.select('df', start=a_start_i, stop=a_stop_i)
for b in range(int(nrows_b / b_chunk_size) + 1):
    b_start_i = b * b_chunk_size
b_stop_i = min((b + 1) * b_chunk_size, nrows_b)
b = B.select('df', start=b_start_i, stop=b_stop_i)
m = merge_a_b(a, b)
if len(m):
    store.append('df_result', m)
merging two tables with millions of rows in python