cetra3 commented on PR #27391:
URL: https://github.com/apache/datafusion/pull/27391#issuecomment-7267069962

   Thanks. I rebased onto `main`. On the three points:
   
   1. **`merge_batch` does not yield.** That is out of scope here. This PR 
removes the quadratic work, so this query shape no longer holds a thread for 
seconds, but it does not change how the aggregate yields. I added a note to the 
description. I have not opened an issue for it; I can if you want one.
   
   2. **The same pattern elsewhere.** The two sites you linked are fine, but 
`nth_value` over a nested value with a `Utf8View` field is quadratic as well. I 
tried the fix: it has to go in `GroupsAccumulatorAdapter::state`, which every 
adapter-based aggregate uses, so it is outside this PR's scope. I filed #27851 
and will fix it in a separate PR.
   
   3. **Plan for `compact_payload`.** I looked at merging them and would leave 
both as they are. They share about ten lines of recursion. `compact_payload` 
also compacts dictionaries and copies their values, and it can fail; 
`compact_view_buffers` only compacts views and cannot fail. Making 
`compact_view_buffers` handle dictionaries would change `ScalarValue::compact` 
for every caller, which is too much for this fix. A view-only helper is useful 
by itself: #27851 needs it in `GroupsAccumulatorAdapter`. If a combined 
function is wanted later, it can be added next to this one and call it, without 
changing this signature.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to