[5.0] chunk function improved

adding $columns param to chunk function is good for joined tables and defining columns if we want.