thisisnic commented on issue #46571:
URL: https://github.com/apache/arrow/issues/46571#issuecomment-7185849837

   Thanks for reporting this! I'm going through older bug issues to see if we 
can close them out.
   
   The output order of a hash join is not guaranteed; it depends on the join 
implementation (see also #37542). The joined rows are all present and correct, 
only their order differs from the input. To keep the original order, add a 
row-number column to the right table before joining and sort by it afterwards:
   
   ```python
   right = right.append_column("row", pa.array(range(right.num_rows)))
   left.join(right, keys="Idx").sort_by("row")
   ```
   
   Checked on 26.0.1 with the three cases above: this returns `Series` in the 
original order each time.
   
   Closing as not a bug.
   


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