0x26res opened a new issue, #37542:
URL: https://github.com/apache/arrow/issues/37542

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   I'm trying to do a `left outer` join (the default).
   
   When all the keys in left can be found in right, the order of the left table 
is preserved:
   ```python
   import pyarrow as pa
   
   
   left = pa.table(
       {
           "key": ["KEY_1", "KEY_3"],
           "left_value": ["1", "3"],
       }
   )
   
   right = pa.table(
       {
           "key": ["KEY_1", "KEY_3"],
           "right_value": ["1", "3"],
       }
   )
   ```
   
   But if any key from left is missing in right, the order is changed. The 
missing values are put at the end:
   
   ```python
   both = left.join(right, keys=["key"])
   assert both["key"] == left["key"]
   
   
   left = pa.table(
       {
           "key": ["KEY_1", "KEY_2", "KEY_3"],
           "left_value": ["1", "2", "3"],
       }
   )
   
   right = pa.table(
       {
           "key": ["KEY_1", "KEY_3"],
           "right_value": ["1", "3"],
       }
   )
   
   
   both = left.join(right, keys=["key"])
   assert both["key"].to_pylist() == ["KEY_1", "KEY_3", "KEY_2"], "Should be 
1,2,3"
   ```
   
   I know there's no explicit guaranty on the order of the output data on the 
join, but it's weird that it preserve order when values are present, and 
changes it when they are missing. 
   
   Tested with `pyarrow==13.0.0`
   
   ### Component(s)
   
   Python


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