Skip to content

Commit 4bd7aca

Browse files
committed
fix(cube): Retain sort information with Projection pushdown through MemoryExec
1 parent 93a9a78 commit 4bd7aca

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

datafusion/core/src/physical_optimizer/projection_pushdown.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,11 @@ fn try_swapping_with_memory(
217217
memory.original_schema(),
218218
Some(new_projections),
219219
)
220-
.map(|e| Arc::new(e) as _)
220+
.map(|e| {
221+
// The outer projection should have the correct sort information.
222+
let e = e.with_sort_information(projection.properties().equivalence_properties().oeq_class().orderings.clone());
223+
Arc::new(e) as _
224+
})
221225
})
222226
.transpose()
223227
}

0 commit comments

Comments
 (0)