Implement arbitrary aggregation function
Fix an issue when using row_number() and limit() together