mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-31 20:30:37 +00:00
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:
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user