liukun4515 commented on PR #7155:
URL: 
https://github.com/apache/arrow-datafusion/pull/7155#issuecomment-1661960108

   > 
   
   
   
   > In the JoinType::Inner match arm, we also preserve the left ordering.
   > 
   > ```rust
   > JoinType::Inner => {
   >     // We modify the indices of the right order columns because their
   >     // columns are appended to the right side of the left schema.
   >     let mut adjusted_right_order =
   >         adjust_right_order(right_order, left_len)?;
   >     if let Some(left_order) = maybe_left_order {
   >         adjusted_right_order.extend_from_slice(left_order);
   >     }
   >     Some(adjusted_right_order)
   > }
   > ```
   > 
   > Since the function is changed into `calculate_join_output_ordering` into 
`calculate_join_output_order` in a previous PR, this function is not currently 
in main. However, the new function is also adding left order in case of the 
inner join.
   > 
   > ```rust
   > (false, true) => {
   >       // Special case, we can prefix ordering of left side with the 
ordering of right side.
   >       if join_type == JoinType::Inner && probe_side == 
Some(JoinSide::Right) {
   >           merge_vectors(&right_ordering, left_ordering)
   >       } else {
   >           right_ordering
   >       }
   >   }
   > ```
   
   
   I know this changes about `calculate_join_output_ordering`.
   
   If we don't consider the special case 
   
   ```
         if join_type == JoinType::Inner && probe_side == Some(JoinSide::Right) 
{
             merge_vectors(&right_ordering, left_ordering)
   ```
   Does we can get the right result?
   @metesynnada 


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