row_counts function

Build an optree pipeline counts rows.