Skip to content

Commit

Permalink
apply comments
Browse files Browse the repository at this point in the history
Signed-off-by: tison <wander4096@gmail.com>
  • Loading branch information
tisonkun committed Apr 7, 2024
1 parent 56ad492 commit 495e8a9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
7 changes: 3 additions & 4 deletions src/table/src/dist_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,16 @@ use store_api::storage::ScanRequest;

use crate::error::UnsupportedSnafu;
use crate::metadata::{FilterPushDownType, TableInfoRef};
use crate::table::Table;
use crate::TableRef;
use crate::{Table, TableRef};

#[derive(Clone)]
pub struct DistTable;

impl DistTable {
pub fn table(table_info: TableInfoRef) -> TableRef {
let data_source = Arc::new(DummyDataSource);
let thin_table = Table::new(table_info, FilterPushDownType::Inexact, data_source);
Arc::new(thin_table)
let table = Table::new(table_info, FilterPushDownType::Inexact, data_source);
Arc::new(table)
}
}

Expand Down
7 changes: 3 additions & 4 deletions src/table/src/table/numbers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ use store_api::storage::ScanRequest;
use crate::metadata::{
FilterPushDownType, TableId, TableInfoBuilder, TableInfoRef, TableMetaBuilder, TableType,
};
use crate::table::Table;
use crate::TableRef;
use crate::{Table, TableRef};

const NUMBER_COLUMN: &str = "number";

Expand All @@ -50,12 +49,12 @@ impl NumbersTable {

pub fn table_with_name(table_id: TableId, name: String) -> TableRef {
let data_source = Arc::new(NumbersDataSource::new(Self::schema()));
let thin_table = Table::new(
let table = Table::new(
Self::table_info(table_id, name, "test_engine".to_string()),
FilterPushDownType::Unsupported,
data_source,
);
Arc::new(thin_table)
Arc::new(table)
}

pub fn schema() -> SchemaRef {
Expand Down
7 changes: 3 additions & 4 deletions src/table/src/test_util/empty_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ use store_api::data_source::DataSource;
use store_api::storage::ScanRequest;

use crate::metadata::{FilterPushDownType, TableInfo};
use crate::table::Table;
use crate::TableRef;
use crate::{Table, TableRef};

pub struct EmptyTable;

Expand All @@ -31,12 +30,12 @@ impl EmptyTable {
let data_source = Arc::new(EmptyDataSource {
schema: info.meta.schema.clone(),
});
let thin_table = Table::new(
let table = Table::new(
Arc::new(info.clone()),
FilterPushDownType::Unsupported,
data_source,
);
Arc::new(thin_table)
Arc::new(table)
}
}

Expand Down
7 changes: 3 additions & 4 deletions src/table/src/test_util/memtable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ use crate::error::{SchemaConversionSnafu, TableProjectionSnafu, TablesRecordBatc
use crate::metadata::{
FilterPushDownType, TableId, TableInfoBuilder, TableMetaBuilder, TableType, TableVersion,
};
use crate::table::Table;
use crate::TableRef;
use crate::{Table, TableRef};

pub struct MemTable;

Expand Down Expand Up @@ -95,8 +94,8 @@ impl MemTable {
);

let data_source = Arc::new(MemtableDataSource { recordbatch });
let thin_table = Table::new(info, FilterPushDownType::Unsupported, data_source);
Arc::new(thin_table)
let table = Table::new(info, FilterPushDownType::Unsupported, data_source);
Arc::new(table)
}

/// Creates a 1 column 100 rows table, with table name "numbers", column name "uint32s" and
Expand Down

0 comments on commit 495e8a9

Please sign in to comment.