refactor: changes CreateTableRequest::schema to RawSchema (#1018)

* refactor: changes CreateTableRequest::schema to RawSchema

* refactor(grpc-expr): create_table_schema returns RawSchema
This commit is contained in:
Yingwen
2023-02-16 16:04:17 +08:00
committed by GitHub
parent a8c2b35ec6
commit ddbc97befb
19 changed files with 139 additions and 169 deletions

View File

@@ -16,7 +16,7 @@
use std::collections::HashMap;
use datatypes::prelude::VectorRef;
use datatypes::schema::{ColumnSchema, SchemaRef};
use datatypes::schema::{ColumnSchema, RawSchema};
use store_api::storage::RegionNumber;
use crate::metadata::TableId;
@@ -45,7 +45,7 @@ pub struct CreateTableRequest {
pub schema_name: String,
pub table_name: String,
pub desc: Option<String>,
pub schema: SchemaRef,
pub schema: RawSchema,
pub region_numbers: Vec<u32>,
pub primary_key_indices: Vec<usize>,
pub create_if_not_exists: bool,

View File

@@ -29,8 +29,9 @@ pub struct EmptyTable {
impl EmptyTable {
pub fn new(req: CreateTableRequest) -> Self {
let schema = Arc::new(req.schema.try_into().unwrap());
let table_meta = TableMetaBuilder::default()
.schema(req.schema)
.schema(schema)
.primary_key_indices(req.primary_key_indices)
.next_column_id(0)
.options(req.table_options)