mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-08-12 09:19:44 +00:00
chore: support specifying skipping index in pipeline (#5635)
* chore: support setting skipping index in pipeline * chore: fix typo key * chore: add test * chore: fix typo
This commit is contained in:
@@ -111,9 +111,9 @@ pub enum Error {
|
||||
},
|
||||
|
||||
#[snafu(display(
|
||||
"Fulltext index only supports string type, column: {column_name}, unexpected type: {column_type:?}"
|
||||
"Fulltext or Skipping index only supports string type, column: {column_name}, unexpected type: {column_type:?}"
|
||||
))]
|
||||
InvalidFulltextColumnType {
|
||||
InvalidStringIndexColumnType {
|
||||
column_name: String,
|
||||
column_type: ColumnDataType,
|
||||
#[snafu(implicit)]
|
||||
@@ -173,7 +173,7 @@ impl ErrorExt for Error {
|
||||
StatusCode::InvalidArguments
|
||||
}
|
||||
|
||||
Error::UnknownColumnDataType { .. } | Error::InvalidFulltextColumnType { .. } => {
|
||||
Error::UnknownColumnDataType { .. } | Error::InvalidStringIndexColumnType { .. } => {
|
||||
StatusCode::InvalidArguments
|
||||
}
|
||||
Error::InvalidSetTableOptionRequest { .. }
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
use std::collections::HashSet;
|
||||
|
||||
use api::v1::column_data_type_extension::TypeExt;
|
||||
use api::v1::column_def::contains_fulltext;
|
||||
use api::v1::column_def::{contains_fulltext, contains_skipping};
|
||||
use api::v1::{
|
||||
AddColumn, AddColumns, Column, ColumnDataType, ColumnDataTypeExtension, ColumnDef,
|
||||
ColumnOptions, ColumnSchema, CreateTableExpr, JsonTypeExtension, SemanticType,
|
||||
@@ -27,7 +27,7 @@ use table::table_reference::TableReference;
|
||||
|
||||
use crate::error::{
|
||||
self, DuplicatedColumnNameSnafu, DuplicatedTimestampColumnSnafu,
|
||||
InvalidFulltextColumnTypeSnafu, MissingTimestampColumnSnafu, Result,
|
||||
InvalidStringIndexColumnTypeSnafu, MissingTimestampColumnSnafu, Result,
|
||||
UnknownColumnDataTypeSnafu,
|
||||
};
|
||||
pub struct ColumnExpr<'a> {
|
||||
@@ -152,8 +152,9 @@ pub fn build_create_table_expr(
|
||||
let column_type = infer_column_datatype(datatype, datatype_extension)?;
|
||||
|
||||
ensure!(
|
||||
!contains_fulltext(options) || column_type == ColumnDataType::String,
|
||||
InvalidFulltextColumnTypeSnafu {
|
||||
(!contains_fulltext(options) && !contains_skipping(options))
|
||||
|| column_type == ColumnDataType::String,
|
||||
InvalidStringIndexColumnTypeSnafu {
|
||||
column_name,
|
||||
column_type,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user