From c5b7b6d8ac2d72aeeefd31df1ba6596bd85d8f90 Mon Sep 17 00:00:00 2001
From: Liang-Chi Hsieh <viirya@gmail.com>
Date: Thu, 25 Jan 2024 14:41:29 -0800
Subject: [PATCH] Fix

---
 datafusion/physical-plan/src/joins/utils.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/datafusion/physical-plan/src/joins/utils.rs b/datafusion/physical-plan/src/joins/utils.rs
index 2224aecfafaa..a480f2ecbe92 100644
--- a/datafusion/physical-plan/src/joins/utils.rs
+++ b/datafusion/physical-plan/src/joins/utils.rs
@@ -575,8 +575,8 @@ pub fn calculate_join_output_ordering(
                 )
                 .ok()?;
                 merge_vectors(
-                    right_ordering,
                     &offset_ordering(right_ordering, &join_type, left_columns_len),
+                    left_ordering,
                 )
             } else {
                 offset_ordering(right_ordering, &join_type, left_columns_len)