Dremio aggregation performance

From the code level, seems the aggregation is happend on top of the data set. That means if we query max, sum, it need get all the result data from data set, then Dremio calculate it. If this case, there should be some concerns for the performance and memory. Is my understanding correct?

I am asking this question, because we have a customized plugin. For the aggregation query, I did not see an existing plugin to follow. If we deliver aggregation to dremio, it will get huge result from our data set, it will impact the performance. But actually, it should be very quickly to get it from our data set. Any advise?

Could anyone advise if the customized plugin need implement the aggregation or need deliver to dremio to process?