PHOENIX-944 Support derived tables in FROM clause that needs extra steps of client-side aggregation or other processing