mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-29 19:30:37 +00:00
refactor: common semantic-type (#2057)
This commit is contained in:
@@ -611,7 +611,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_column_put_vector() {
|
||||
use crate::v1::column::SemanticType;
|
||||
use crate::v1::SemanticType;
|
||||
// Some(false), None, Some(true), Some(true)
|
||||
let mut column = Column {
|
||||
column_name: "test".to_string(),
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use api::v1::column::*;
|
||||
use api::v1::*;
|
||||
use client::{Client, Database, DEFAULT_SCHEMA_NAME};
|
||||
use derive_new::new;
|
||||
|
||||
@@ -16,10 +16,10 @@ use std::collections::{HashMap, HashSet};
|
||||
use std::sync::Arc;
|
||||
|
||||
use api::helper::ColumnDataTypeWrapper;
|
||||
use api::v1::column::{SemanticType, Values};
|
||||
use api::v1::column::Values;
|
||||
use api::v1::{
|
||||
AddColumn, AddColumns, Column, ColumnDataType, ColumnDef, CreateTableExpr,
|
||||
InsertRequest as GrpcInsertRequest,
|
||||
InsertRequest as GrpcInsertRequest, SemanticType,
|
||||
};
|
||||
use common_base::BitVec;
|
||||
use common_time::time::Time;
|
||||
@@ -575,8 +575,8 @@ mod tests {
|
||||
use std::{assert_eq, vec};
|
||||
|
||||
use api::helper::ColumnDataTypeWrapper;
|
||||
use api::v1::column::{self, SemanticType, Values};
|
||||
use api::v1::{Column, ColumnDataType};
|
||||
use api::v1::column::Values;
|
||||
use api::v1::{Column, ColumnDataType, SemanticType};
|
||||
use common_base::BitVec;
|
||||
use common_catalog::consts::MITO_ENGINE;
|
||||
use common_time::timestamp::{TimeUnit, Timestamp};
|
||||
@@ -1028,7 +1028,7 @@ mod tests {
|
||||
fn mock_insert_batch() -> (Vec<Column>, u32) {
|
||||
let row_count = 2;
|
||||
|
||||
let host_vals = column::Values {
|
||||
let host_vals = Values {
|
||||
string_values: vec!["host1".to_string(), "host2".to_string()],
|
||||
..Default::default()
|
||||
};
|
||||
@@ -1040,7 +1040,7 @@ mod tests {
|
||||
datatype: ColumnDataType::String as i32,
|
||||
};
|
||||
|
||||
let cpu_vals = column::Values {
|
||||
let cpu_vals = Values {
|
||||
f64_values: vec![0.31],
|
||||
..Default::default()
|
||||
};
|
||||
@@ -1052,7 +1052,7 @@ mod tests {
|
||||
datatype: ColumnDataType::Float64 as i32,
|
||||
};
|
||||
|
||||
let mem_vals = column::Values {
|
||||
let mem_vals = Values {
|
||||
f64_values: vec![0.1],
|
||||
..Default::default()
|
||||
};
|
||||
@@ -1064,7 +1064,7 @@ mod tests {
|
||||
datatype: ColumnDataType::Float64 as i32,
|
||||
};
|
||||
|
||||
let time_vals = column::Values {
|
||||
let time_vals = Values {
|
||||
time_millisecond_values: vec![100, 101],
|
||||
..Default::default()
|
||||
};
|
||||
@@ -1076,7 +1076,7 @@ mod tests {
|
||||
datatype: ColumnDataType::TimeMillisecond as i32,
|
||||
};
|
||||
|
||||
let ts_vals = column::Values {
|
||||
let ts_vals = Values {
|
||||
ts_millisecond_values: vec![100, 101],
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
@@ -16,8 +16,7 @@ use std::collections::HashMap;
|
||||
use std::fmt::Display;
|
||||
|
||||
use api::helper::values_with_capacity;
|
||||
use api::v1::column::SemanticType;
|
||||
use api::v1::{Column, ColumnDataType};
|
||||
use api::v1::{Column, ColumnDataType, SemanticType};
|
||||
use common_base::BitVec;
|
||||
use snafu::ensure;
|
||||
|
||||
@@ -262,8 +261,7 @@ impl Display for Precision {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use api::v1::column::SemanticType;
|
||||
use api::v1::ColumnDataType;
|
||||
use api::v1::{ColumnDataType, SemanticType};
|
||||
use common_base::BitVec;
|
||||
|
||||
use super::LinesWriter;
|
||||
|
||||
@@ -301,11 +301,11 @@ async fn new_dummy_catalog_list(
|
||||
mod test {
|
||||
use api::v1::add_column::location::LocationType;
|
||||
use api::v1::add_column::Location;
|
||||
use api::v1::column::{SemanticType, Values};
|
||||
use api::v1::column::Values;
|
||||
use api::v1::{
|
||||
alter_expr, AddColumn, AddColumns, AlterExpr, Column, ColumnDataType, ColumnDef,
|
||||
CreateDatabaseExpr, CreateTableExpr, DropTableExpr, InsertRequest, InsertRequests,
|
||||
QueryRequest, RenameTable, TableId, TruncateTableExpr,
|
||||
QueryRequest, RenameTable, SemanticType, TableId, TruncateTableExpr,
|
||||
};
|
||||
use common_catalog::consts::MITO_ENGINE;
|
||||
use common_error::ext::ErrorExt;
|
||||
|
||||
@@ -175,8 +175,8 @@ impl DistInserter {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use api::v1::column::{SemanticType, Values};
|
||||
use api::v1::{Column, ColumnDataType, InsertRequest as GrpcInsertRequest};
|
||||
use api::v1::column::Values;
|
||||
use api::v1::{Column, ColumnDataType, InsertRequest as GrpcInsertRequest, SemanticType};
|
||||
use client::client_manager::DatanodeClients;
|
||||
use common_catalog::consts::{DEFAULT_CATALOG_NAME, DEFAULT_SCHEMA_NAME};
|
||||
use common_meta::helper::{CatalogKey, CatalogValue, SchemaKey, SchemaValue};
|
||||
|
||||
@@ -68,8 +68,8 @@ mod tests {
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
|
||||
use api::v1::column::{SemanticType, Values};
|
||||
use api::v1::{Column, ColumnDataType};
|
||||
use api::v1::column::Values;
|
||||
use api::v1::{Column, ColumnDataType, SemanticType};
|
||||
use datatypes::prelude::{ConcreteDataType, VectorRef};
|
||||
use datatypes::schema::{ColumnSchema, Schema};
|
||||
use datatypes::vectors::Int32Vector;
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use api::helper::{push_vals, ColumnDataTypeWrapper};
|
||||
use api::v1::column::{SemanticType, Values};
|
||||
use api::v1::{Column, InsertRequest as GrpcInsertRequest};
|
||||
use api::v1::column::Values;
|
||||
use api::v1::{Column, InsertRequest as GrpcInsertRequest, SemanticType};
|
||||
use datatypes::prelude::*;
|
||||
use snafu::{ensure, OptionExt, ResultExt};
|
||||
use store_api::storage::RegionNumber;
|
||||
|
||||
@@ -151,8 +151,8 @@ fn unwarp_or_default_precision(precision: Option<Precision>) -> Precision {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use api::v1::column::{SemanticType, Values};
|
||||
use api::v1::{Column, ColumnDataType};
|
||||
use api::v1::column::Values;
|
||||
use api::v1::{Column, ColumnDataType, SemanticType};
|
||||
use common_base::BitVec;
|
||||
|
||||
use super::*;
|
||||
|
||||
@@ -12,8 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use api::v1::column::SemanticType;
|
||||
use api::v1::{column, Column, ColumnDataType, InsertRequest as GrpcInsertRequest};
|
||||
use api::v1::{column, Column, ColumnDataType, InsertRequest as GrpcInsertRequest, SemanticType};
|
||||
|
||||
use crate::error::{self, Result};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user