From 545a80c6e0ce808fa06b68615d2108784b259dd5 Mon Sep 17 00:00:00 2001 From: jeremyhi Date: Mon, 9 Sep 2024 20:14:17 +0800 Subject: [PATCH] chore: remove unused method (#4703) --- src/common/grpc-expr/src/insert.rs | 20 ++++++++++---------- src/common/grpc-expr/src/lib.rs | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/common/grpc-expr/src/insert.rs b/src/common/grpc-expr/src/insert.rs index 6170c5300858..56ed7e5bf02f 100644 --- a/src/common/grpc-expr/src/insert.rs +++ b/src/common/grpc-expr/src/insert.rs @@ -14,11 +14,10 @@ use api::helper; use api::v1::column::Values; -use api::v1::{AddColumns, Column, CreateTableExpr}; +use api::v1::{Column, CreateTableExpr}; use common_base::BitVec; use datatypes::data_type::{ConcreteDataType, DataType}; use datatypes::prelude::VectorRef; -use datatypes::schema::SchemaRef; use snafu::{ensure, ResultExt}; use table::metadata::TableId; use table::table_reference::TableReference; @@ -27,11 +26,6 @@ use crate::error::{CreateVectorSnafu, Result, UnexpectedValuesLengthSnafu}; use crate::util; use crate::util::ColumnExpr; -pub fn find_new_columns(schema: &SchemaRef, columns: &[Column]) -> Result> { - let column_exprs = ColumnExpr::from_columns(columns); - util::extract_new_columns(schema, column_exprs) -} - /// Try to build create table request from insert data. pub fn build_create_expr_from_insertion( catalog_name: &str, @@ -114,7 +108,6 @@ mod tests { use super::*; use crate::error; use crate::error::ColumnDataTypeSnafu; - use crate::insert::find_new_columns; #[inline] fn build_column_schema( @@ -281,11 +274,18 @@ mod tests { let schema = Arc::new(SchemaBuilder::try_from(columns).unwrap().build().unwrap()); - assert!(find_new_columns(&schema, &[]).unwrap().is_none()); + assert!( + util::extract_new_columns(&schema, ColumnExpr::from_columns(&[])) + .unwrap() + .is_none() + ); let insert_batch = mock_insert_batch(); - let add_columns = find_new_columns(&schema, &insert_batch.0).unwrap().unwrap(); + let add_columns = + util::extract_new_columns(&schema, ColumnExpr::from_columns(&insert_batch.0)) + .unwrap() + .unwrap(); assert_eq!(5, add_columns.add_columns.len()); let host_column = &add_columns.add_columns[0]; diff --git a/src/common/grpc-expr/src/lib.rs b/src/common/grpc-expr/src/lib.rs index 7a2fea237b52..c8afaf98d9a3 100644 --- a/src/common/grpc-expr/src/lib.rs +++ b/src/common/grpc-expr/src/lib.rs @@ -19,4 +19,4 @@ pub mod insert; pub mod util; pub use alter::{alter_expr_to_request, create_table_schema}; -pub use insert::{build_create_expr_from_insertion, find_new_columns}; +pub use insert::build_create_expr_from_insertion;