Skip to content

Commit

Permalink
chore(cubestore): Upgrade DF: fix ordering issues
Browse files Browse the repository at this point in the history
  • Loading branch information
paveltiunov committed Nov 27, 2024
1 parent e224d1d commit 9f11549
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 3 additions & 0 deletions rust/cubestore/cubestore/src/queryplanner/pretty_printers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ use datafusion::physical_plan::projection::ProjectionExec;
use datafusion::physical_plan::repartition::RepartitionExec;

Check warning on line 37 in rust/cubestore/cubestore/src/queryplanner/pretty_printers.rs

View workflow job for this annotation

GitHub Actions / Debian Rust nightly-2024-01-29

Diff in /home/runner/work/cube/cube/rust/cubestore/cubestore/src/queryplanner/pretty_printers.rs
use datafusion::physical_plan::sorts::sort::SortExec;
use datafusion::physical_plan::union::UnionExec;
use crate::queryplanner::providers::InfoSchemaQueryCacheTableProvider;

#[derive(Default, Clone, Copy)]
pub struct PPOptions {
Expand Down Expand Up @@ -305,6 +306,8 @@ fn pp_source(t: Arc<dyn TableProvider>) -> String {
format!("InlineTableProvider(data: {} rows)", t.get_data().len())

Check warning on line 306 in rust/cubestore/cubestore/src/queryplanner/pretty_printers.rs

View workflow job for this annotation

GitHub Actions / Debian Rust nightly-2024-01-29

Diff in /home/runner/work/cube/cube/rust/cubestore/cubestore/src/queryplanner/pretty_printers.rs
} else if let Some(t) = t.as_any().downcast_ref::<InfoSchemaTableProvider>() {
format!("InfoSchemaTableProvider(table: {:?})", t.table)
} else if let Some(_) = t.as_any().downcast_ref::<InfoSchemaQueryCacheTableProvider>() {
"InfoSchemaQueryCacheTableProvider".to_string()
} else {
panic!("unknown table provider");
}
Expand Down
16 changes: 15 additions & 1 deletion rust/cubestore/cubestore/src/queryplanner/query_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1523,8 +1523,22 @@ impl ExecutionPlan for ClusterSendExec {
&self.properties
}

fn required_input_ordering(&self) -> Vec<Option<LexRequirement>> {
let input_ordering = self.input_for_optimizations.required_input_ordering();
if !input_ordering.is_empty() {
vec![input_ordering[0].clone()]
} else {
vec![None]
}
}

fn maintains_input_order(&self) -> Vec<bool> {
vec![true; self.children().len()]
let maintains_input_order = self.input_for_optimizations.maintains_input_order();
if !maintains_input_order.is_empty() {
vec![maintains_input_order[0]]
} else {
vec![false]
}
}
}

Expand Down

0 comments on commit 9f11549

Please sign in to comment.