mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-26 01:40:36 +00:00
feat: remove code
This commit is contained in:
@@ -31,6 +31,7 @@ pub mod manifest;
|
||||
pub mod memtable;
|
||||
#[allow(dead_code)]
|
||||
pub mod metadata;
|
||||
#[allow(dead_code)]
|
||||
pub(crate) mod proto_util;
|
||||
pub mod read;
|
||||
#[allow(dead_code)]
|
||||
|
||||
@@ -18,18 +18,14 @@ use std::collections::HashMap;
|
||||
use std::time::Duration;
|
||||
|
||||
use common_base::readable_size::ReadableSize;
|
||||
use greptime_proto::v1::{ColumnDataType, ColumnSchema, Rows};
|
||||
use snafu::{ensure, OptionExt, ResultExt};
|
||||
use greptime_proto::v1::Rows;
|
||||
use snafu::ensure;
|
||||
use store_api::storage::{ColumnId, CompactionStrategy, OpType, RegionId};
|
||||
use tokio::sync::oneshot::{self, Receiver, Sender};
|
||||
|
||||
use crate::config::DEFAULT_WRITE_BUFFER_SIZE;
|
||||
use crate::error::{CreateDefaultSnafu, FillDefaultSnafu, InvalidRequestSnafu, Result};
|
||||
use crate::error::{FillDefaultSnafu, InvalidRequestSnafu, Result};
|
||||
use crate::metadata::{ColumnMetadata, RegionMetadata};
|
||||
use crate::proto_util::{
|
||||
check_column_type, check_semantic_type, to_column_data_type, to_proto_semantic_type,
|
||||
to_proto_value,
|
||||
};
|
||||
|
||||
/// Options that affect the entire region.
|
||||
///
|
||||
@@ -144,36 +140,8 @@ impl WriteRequest {
|
||||
|
||||
// Checks all columns in this region.
|
||||
for column in &metadata.column_metadatas {
|
||||
if let Some(input_col) = rows_columns.remove(&column.column_schema.name) {
|
||||
// Check data type.
|
||||
ensure!(
|
||||
check_column_type(input_col.datatype, &column.column_schema.data_type),
|
||||
InvalidRequestSnafu {
|
||||
region_id,
|
||||
reason: format!(
|
||||
"column {} expect type {:?}, given: {:?}({})",
|
||||
column.column_schema.name,
|
||||
column.column_schema.data_type,
|
||||
ColumnDataType::from_i32(input_col.datatype),
|
||||
input_col.datatype,
|
||||
)
|
||||
}
|
||||
);
|
||||
|
||||
// Check semantic type.
|
||||
ensure!(
|
||||
check_semantic_type(input_col.semantic_type, column.semantic_type),
|
||||
InvalidRequestSnafu {
|
||||
region_id,
|
||||
reason: format!(
|
||||
"column {} has semantic type {:?}, given: {:?}({})",
|
||||
column.column_schema.name,
|
||||
column.semantic_type,
|
||||
greptime_proto::v1::SemanticType::from_i32(input_col.semantic_type),
|
||||
input_col.semantic_type
|
||||
),
|
||||
}
|
||||
);
|
||||
if let Some(_input_col) = rows_columns.remove(&column.column_schema.name) {
|
||||
todo!("Check data type and semantic type");
|
||||
} else {
|
||||
// For columns not in rows, checks whether they have default value.
|
||||
ensure!(
|
||||
@@ -221,7 +189,7 @@ impl WriteRequest {
|
||||
}
|
||||
|
||||
/// Fill default value for specific `column`.
|
||||
fn fill_column(&mut self, region_id: RegionId, column: &ColumnMetadata) -> Result<()> {
|
||||
fn fill_column(&mut self, _region_id: RegionId, _column: &ColumnMetadata) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user