If I understand correctly, the call to heapq.merge() will merge by all columns instead of the columns variable. This can be changed to:
keyfunc = lambda row: [row[column] for column in columns]
writer.writerows(heapq.merge(*rows, key=keyfunc))
Will submit a PR for this.