Skip to content

Commit

Permalink
chore(cubestore): Upgrade DF: fix filter pushdown to CubeTable
Browse files Browse the repository at this point in the history
  • Loading branch information
paveltiunov committed Nov 28, 2024
1 parent 2c01a51 commit 3f8b2df
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
5 changes: 3 additions & 2 deletions rust/cubestore/cubestore-sql-tests/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@ pub fn sql_tests() -> Vec<(&'static str, TestFn)> {
t("float_merge", float_merge),
t("join", join),
t("filtered_join", filtered_join),
t("three_tables_join", three_tables_join),
// TODO upgrade DF stack overflow
// t("three_tables_join", three_tables_join),
t(
"three_tables_join_with_filter",
three_tables_join_with_filter,
),
// TODO upgrade DF
// TODO upgrade DF stack overflow
// t("three_tables_join_with_union", three_tables_join_with_union),
t("in_list", in_list),
t("in_list_with_union", in_list_with_union),
Expand Down
17 changes: 9 additions & 8 deletions rust/cubestore/cubestore/src/queryplanner/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ use datafusion::datasource::{provider_as_source, DefaultTableSource, TableType};
use datafusion::error::DataFusionError;
use datafusion::execution::{SessionState, TaskContext};
use datafusion::logical_expr::{
AggregateUDF, Expr, Extension, LogicalPlan, ScalarUDF, TableSource, WindowUDF,
AggregateUDF, Expr, Extension, LogicalPlan, ScalarUDF, TableProviderFilterPushDown,
TableSource, WindowUDF,
};
use datafusion::physical_expr::EquivalenceProperties;
use datafusion::physical_plan::memory::MemoryExec;
Expand Down Expand Up @@ -846,13 +847,13 @@ impl TableProvider for CubeTableLogical {
) -> Result<Arc<dyn ExecutionPlan>, DataFusionError> {
panic!("scan has been called on CubeTableLogical: serialized plan wasn't preprocessed for select");
}
//
// fn supports_filter_pushdown(
// &self,
// _filter: &Expr,
// ) -> Result<TableProviderFilterPushDown, DataFusionError> {
// return Ok(TableProviderFilterPushDown::Inexact);
// }

fn supports_filters_pushdown(
&self,
filters: &[&Expr],
) -> datafusion::common::Result<Vec<TableProviderFilterPushDown>> {
Ok(vec![TableProviderFilterPushDown::Inexact; filters.len()])
}
}

fn compute_workers(
Expand Down

0 comments on commit 3f8b2df

Please sign in to comment.