Skip to content

Commit

Permalink
remove default impl
Browse files Browse the repository at this point in the history
  • Loading branch information
jiacai2050 committed Aug 14, 2023
1 parent fc971ba commit c379fa5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
10 changes: 5 additions & 5 deletions analytic_engine/src/table/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,15 +401,15 @@ impl TableImpl {
}
}

pub fn support_pushdown(schema: &Schema, need_dedup: bool, columns: &[String]) -> bool {
pub fn support_pushdown(schema: &Schema, need_dedup: bool, col_names: &[String]) -> bool {
if !need_dedup {
return true;
}

// When table need dedup, only unique keys columns support pushdown
columns
col_names
.iter()
.all(|col| schema.is_unique_column(col.as_str()))
.all(|col_name| schema.is_unique_column(col_name.as_str()))
}

#[async_trait]
Expand Down Expand Up @@ -442,10 +442,10 @@ impl Table for TableImpl {
self.table_data.metrics.table_stats()
}

fn support_pushdown(&self, read_schema: &Schema, columns: &[String]) -> bool {
fn support_pushdown(&self, read_schema: &Schema, col_names: &[String]) -> bool {
let need_dedup = self.table_data.table_options().need_dedup();

support_pushdown(read_schema, need_dedup, columns)
support_pushdown(read_schema, need_dedup, col_names)
}

async fn write(&self, request: WriteRequest) -> Result<usize> {
Expand Down
4 changes: 2 additions & 2 deletions partition_table_engine/src/partition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ impl Table for PartitionTableImpl {
}

// TODO: maybe we should ask remote sub table whether support pushdown
fn support_pushdown(&self, read_schema: &Schema, columns: &[String]) -> bool {
fn support_pushdown(&self, read_schema: &Schema, col_names: &[String]) -> bool {
let need_dedup = self.table_data.options.need_dedup();

support_pushdown(read_schema, need_dedup, columns)
support_pushdown(read_schema, need_dedup, col_names)
}

async fn write(&self, request: WriteRequest) -> Result<usize> {
Expand Down
4 changes: 4 additions & 0 deletions system_catalog/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ impl Table for SystemTableAdapter {
TableStats::default()
}

fn support_pushdown(&self, _read_schema: &Schema, _col_names: &[String]) -> bool {
false
}

async fn write(&self, _request: WriteRequest) -> table_engine::table::Result<usize> {
Ok(0)
}
Expand Down
4 changes: 4 additions & 0 deletions table_engine/src/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ impl Table for MemoryTable {
TableStats::default()
}

fn support_pushdown(&self, _read_schema: &Schema, _col_names: &[String]) -> bool {
false
}

async fn write(&self, request: WriteRequest) -> Result<usize> {
// TODO(yingwen) Maybe check schema?
let mut row_groups = self.row_groups.write().unwrap();
Expand Down
4 changes: 1 addition & 3 deletions table_engine/src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,7 @@ pub trait Table: std::fmt::Debug {
/// Whether the columns used in filter expr can be pushdown....
/// `read_schema` is used here to avoid upper layer see different schema
/// during one query.
fn support_pushdown(&self, _read_schema: &Schema, _columns: &[String]) -> bool {
false
}
fn support_pushdown(&self, _read_schema: &Schema, _col_names: &[String]) -> bool;

/// Write to table.
async fn write(&self, request: WriteRequest) -> Result<usize>;
Expand Down

0 comments on commit c379fa5

Please sign in to comment.