feat: move time index metadata from schema into field (#444)

* feat: move time index metadata from schema into field

* chore: remove useless code

* test: test select with column alias

* fix: conflicts with develop branch

* test: add test

* test: order by timestamp to ensure query results order

* fix: comment
This commit is contained in:
dennis zhuang
2022-11-11 15:36:27 +08:00
committed by GitHub
parent e7b4d24df5
commit 74ea529d1a
30 changed files with 249 additions and 165 deletions

View File

@@ -220,7 +220,7 @@ fn parse_column_default_constraint(
// TODO(yingwen): Make column nullable by default, and checks invalid case like
// a column is not nullable but has a default value null.
/// Create a `ColumnSchema` from `ColumnDef`.
pub fn column_def_to_schema(column_def: &ColumnDef) -> Result<ColumnSchema> {
pub fn column_def_to_schema(column_def: &ColumnDef, is_time_index: bool) -> Result<ColumnSchema> {
let is_nullable = column_def
.options
.iter()
@@ -232,6 +232,7 @@ pub fn column_def_to_schema(column_def: &ColumnDef) -> Result<ColumnSchema> {
parse_column_default_constraint(&name, &data_type, &column_def.options)?;
ColumnSchema::new(name, data_type, is_nullable)
.with_time_index(is_time_index)
.with_default_constraint(default_constraint)
.context(error::InvalidDefaultSnafu {
column: &column_def.name.value,