Skip to content

Commit dacfbae

Browse files
committed
fix(cube): Retain sort information with Projection pushdown through MemorySourceConfig
1 parent 8095609 commit dacfbae

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

datafusion/datasource/src/memory.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,12 +469,15 @@ impl DataSource for MemorySourceConfig {
469469
self.projection().as_ref().unwrap_or(&all_projections),
470470
);
471471

472-
MemorySourceConfig::try_new_exec(
472+
MemorySourceConfig::try_new(
473473
self.partitions(),
474474
self.original_schema(),
475475
Some(new_projections),
476-
)
477-
.map(|e| e as _)
476+
).and_then(|memory_source| {
477+
// The projection gets applied to the sort information -- so we use the original underlying sort information.
478+
let s = memory_source.try_with_sort_information(self.sort_information.clone())?;
479+
Ok(Arc::new(DataSourceExec::new(Arc::new(s))) as _)
480+
})
478481
})
479482
.transpose()
480483
}

0 commit comments

Comments
 (0)