Skip to content

Commit

Permalink
chore: nit change
Browse files Browse the repository at this point in the history
Signed-off-by: Zhenchi <[email protected]>
  • Loading branch information
zhongzc authored and WenyXu committed Sep 12, 2023
1 parent 136feff commit eb48426
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
18 changes: 9 additions & 9 deletions src/frontend/src/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ use crate::error::{
};
use crate::req_convert::delete::{ColumnToRow, RowToRegion, TableToRegion};

pub(crate) struct Deleter {
pub struct Deleter {
catalog_manager: CatalogManagerRef,
partition_manager: PartitionRuleManagerRef,
datanode_manager: DatanodeManagerRef,
}

pub(crate) type DeleterRef = Arc<Deleter>;
pub type DeleterRef = Arc<Deleter>;

impl Deleter {
pub fn new(
Expand Down Expand Up @@ -126,12 +126,12 @@ impl Deleter {
.await?
.into_iter()
.map(|(peer, deletes)| {
let request = RegionRequest {
header: Some(RegionRequestHeader { trace_id, span_id }),
body: Some(region_request::Body::Deletes(deletes)),
};
let datanode_manager = self.datanode_manager.clone();
common_runtime::spawn_write(async move {
let request = RegionRequest {
header: Some(RegionRequestHeader { trace_id, span_id }),
body: Some(region_request::Body::Deletes(deletes)),
};
datanode_manager
.datanode(&peer)
.await
Expand Down Expand Up @@ -181,9 +181,9 @@ impl Deleter {
ctx: &QueryContextRef,
) -> Result<RowDeleteRequests> {
for req in &mut requests.deletes {
let table = self
.get_table(ctx.current_catalog(), ctx.current_schema(), &req.table_name)
.await?;
let catalog = ctx.current_catalog();
let schema = ctx.current_schema();
let table = self.get_table(catalog, schema, &req.table_name).await?;
let key_column_names = self.key_column_names(&table)?;

let rows = req.rows.as_mut().unwrap();
Expand Down
12 changes: 6 additions & 6 deletions src/frontend/src/insert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ use crate::expr_factory::CreateExprFactory;
use crate::req_convert::insert::{ColumnToRow, RowToRegion, StatementToRegion, TableToRegion};
use crate::statement::StatementExecutor;

pub(crate) struct Inserter {
pub struct Inserter {
catalog_manager: CatalogManagerRef,
partition_manager: PartitionRuleManagerRef,
datanode_manager: DatanodeManagerRef,
}

pub(crate) type InserterRef = Arc<Inserter>;
pub type InserterRef = Arc<Inserter>;

impl Inserter {
pub fn new(
Expand Down Expand Up @@ -157,12 +157,12 @@ impl Inserter {
.await?
.into_iter()
.map(|(peer, inserts)| {
let request = RegionRequest {
header: Some(RegionRequestHeader { trace_id, span_id }),
body: Some(region_request::Body::Inserts(inserts)),
};
let datanode_manager = self.datanode_manager.clone();
common_runtime::spawn_write(async move {
let request = RegionRequest {
header: Some(RegionRequestHeader { trace_id, span_id }),
body: Some(region_request::Body::Inserts(inserts)),
};
datanode_manager
.datanode(&peer)
.await
Expand Down

0 comments on commit eb48426

Please sign in to comment.