ygoogole opened a new issue, #46571:
URL: https://github.com/apache/arrow/issues/46571

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   Here table left and right joins by Idx column, "Series" column in right 
table has its original sequence always reversed in output table. How to 
preserve original ordering ?
   
   def test_hash_join_order():
       # Test with different Series orders in right table
       left = pa.table({'City': ["NEWYORK"], 'Number': [44], 'Idx':[1]})
       
       # Test case 1: Original order [0,1,2,3]
       right1 = pa.table({'Idx': [1, 1, 1, 1], 'Series': [0,1,2,3]})
       
       # Test case 2: Reverse order [3,2,1,0]
       right2 = pa.table({'Idx': [1, 1, 1, 1], 'Series': [3,2,1,0]})
       
       # Test case 3: Random order [2,0,3,1]
       right3 = pa.table({'Idx': [1, 1, 1, 1], 'Series': [2,0,3,1]})
       
       def do_join(right):
           left_source = Declaration("table_source", 
options=TableSourceNodeOptions(left))
           right_source = Declaration("table_source", 
options=TableSourceNodeOptions(right))
           join_opts = HashJoinNodeOptions("left outer", left_keys="Idx", 
right_keys="Idx")
           joined = Declaration("hashjoin", options=join_opts, 
inputs=[left_source, right_source])
           return joined.to_table()
   
       print("Test 1 (Original order):", 
do_join(right1).column('Series').to_pylist())
       print("Test 2 (Reverse order):", 
do_join(right2).column('Series').to_pylist())
       print("Test 3 (Random order):", 
do_join(right3).column('Series').to_pylist())
   
   test_hash_join_order()
   
   ### Component(s)
   
   C++


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