jorisvandenbossche commented on issue #35748:
URL: https://github.com/apache/arrow/issues/35748#issuecomment-1589187240

   > So you can get part of the way there by combining all the chunks and using 
`pyarrow.compute.sort`. This still means the individual chunks will be 
"resorted".
   
   If you want unique values in the end, in general I expect it to be more 
efficient to first get the uniques, and only sort afterwards (that also avoids 
having to materialize the full sorted array).  
   Maybe if you already have mostly sorted / mostly unique chunks to start 
with, that might be different.
   
   ---
   
   Note that we nowadays have a `sort()` helper method that does the 
`sort_indices`+`take` under the hood for you, so you can write Weston's version 
as:
   
   ```
   all_chunks.sort().unique()
   ```
   
   (while my suggestion was `all_chunks.unique().sort()`, i.e. just a different 
order of calling sort vs unique)


-- 
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]

Reply via email to