Skip to content

Commit 9f11549

Browse files
committed
chore(cubestore): Upgrade DF: fix ordering issues
1 parent e224d1d commit 9f11549

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

rust/cubestore/cubestore/src/queryplanner/pretty_printers.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ use datafusion::physical_plan::projection::ProjectionExec;
3737
use datafusion::physical_plan::repartition::RepartitionExec;
3838
use datafusion::physical_plan::sorts::sort::SortExec;
3939
use datafusion::physical_plan::union::UnionExec;
40+
use crate::queryplanner::providers::InfoSchemaQueryCacheTableProvider;
4041

4142
#[derive(Default, Clone, Copy)]
4243
pub struct PPOptions {
@@ -305,6 +306,8 @@ fn pp_source(t: Arc<dyn TableProvider>) -> String {
305306
format!("InlineTableProvider(data: {} rows)", t.get_data().len())
306307
} else if let Some(t) = t.as_any().downcast_ref::<InfoSchemaTableProvider>() {
307308
format!("InfoSchemaTableProvider(table: {:?})", t.table)
309+
} else if let Some(_) = t.as_any().downcast_ref::<InfoSchemaQueryCacheTableProvider>() {
310+
"InfoSchemaQueryCacheTableProvider".to_string()
308311
} else {
309312
panic!("unknown table provider");
310313
}

rust/cubestore/cubestore/src/queryplanner/query_executor.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1523,8 +1523,22 @@ impl ExecutionPlan for ClusterSendExec {
15231523
&self.properties
15241524
}
15251525

1526+
fn required_input_ordering(&self) -> Vec<Option<LexRequirement>> {
1527+
let input_ordering = self.input_for_optimizations.required_input_ordering();
1528+
if !input_ordering.is_empty() {
1529+
vec![input_ordering[0].clone()]
1530+
} else {
1531+
vec![None]
1532+
}
1533+
}
1534+
15261535
fn maintains_input_order(&self) -> Vec<bool> {
1527-
vec![true; self.children().len()]
1536+
let maintains_input_order = self.input_for_optimizations.maintains_input_order();
1537+
if !maintains_input_order.is_empty() {
1538+
vec![maintains_input_order[0]]
1539+
} else {
1540+
vec![false]
1541+
}
15281542
}
15291543
}
15301544

0 commit comments

Comments
 (0)