diff --git a/Cargo.lock b/Cargo.lock
index bdd59547a9e0..ea6cf9997f8e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3159,6 +3159,8 @@ dependencies = [
"serde",
"serde_json",
"snafu 0.8.4",
+ "sqlparser 0.45.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09b11c0c88934690530807185d3e7)",
+ "sqlparser_derive 0.1.1",
]
[[package]]
@@ -4252,7 +4254,7 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
[[package]]
name = "greptime-proto"
version = "0.1.0"
-source = "git+https://github.com/GreptimeTeam/greptime-proto.git?rev=c437b55725b7f5224fe9d46db21072b4a682ee4b#c437b55725b7f5224fe9d46db21072b4a682ee4b"
+source = "git+https://github.com/irenjj/greptime-proto.git?rev=ed13098712a87674e1d41be8c9a8ceb23585c009#ed13098712a87674e1d41be8c9a8ceb23585c009"
dependencies = [
"prost 0.12.6",
"serde",
diff --git a/Cargo.toml b/Cargo.toml
index 4b5fb9369e38..4961430ff7ae 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -119,7 +119,7 @@ etcd-client = { version = "0.13" }
fst = "0.4.7"
futures = "0.3"
futures-util = "0.3"
-greptime-proto = { git = "https://github.com/GreptimeTeam/greptime-proto.git", rev = "c437b55725b7f5224fe9d46db21072b4a682ee4b" }
+greptime-proto = { git = "https://github.com/irenjj/greptime-proto.git", rev = "ed13098712a87674e1d41be8c9a8ceb23585c009" }
humantime = "2.1"
humantime-serde = "1.1"
itertools = "0.10"
@@ -151,7 +151,7 @@ reqwest = { version = "0.12", default-features = false, features = [
"stream",
"multipart",
] }
-# SCRAM-SHA-512 requires https://github.com/dequbed/rsasl/pull/48, https://github.com/influxdata/rskafka/pull/247
+# SCRAM-SHA-512 requires https://github.com/dequbed/rsasl/pull/48, https://github.com/influxdata/rskafka/pull/247
rskafka = { git = "https://github.com/WenyXu/rskafka.git", rev = "940c6030012c5b746fad819fb72e3325b26e39de", features = [
"transport-tls",
] }
diff --git a/src/api/src/error.rs b/src/api/src/error.rs
index 07e43e477299..711e4791ff42 100644
--- a/src/api/src/error.rs
+++ b/src/api/src/error.rs
@@ -66,15 +66,23 @@ pub enum Error {
#[snafu(implicit)]
location: Location,
},
+
+ #[snafu(display("Failed to decode proto"))]
+ DecodeProto {
+ #[snafu(implicit)]
+ location: Location,
+ #[snafu(source)]
+ error: prost::DecodeError,
+ },
}
impl ErrorExt for Error {
fn status_code(&self) -> StatusCode {
match self {
Error::UnknownColumnDataType { .. } => StatusCode::InvalidArguments,
- Error::IntoColumnDataType { .. } | Error::SerializeJson { .. } => {
- StatusCode::Unexpected
- }
+ Error::IntoColumnDataType { .. }
+ | Error::SerializeJson { .. }
+ | Error::DecodeProto { .. } => StatusCode::Unexpected,
Error::ConvertColumnDefaultConstraint { source, .. }
| Error::InvalidColumnDefaultConstraint { source, .. } => source.status_code(),
}
diff --git a/src/api/src/v1/column_def.rs b/src/api/src/v1/column_def.rs
index b4d3425215c8..9702a445d9cd 100644
--- a/src/api/src/v1/column_def.rs
+++ b/src/api/src/v1/column_def.rs
@@ -15,8 +15,10 @@
use std::collections::HashMap;
use datatypes::schema::{
- ColumnDefaultConstraint, ColumnSchema, FulltextOptions, COMMENT_KEY, FULLTEXT_KEY,
+ ChangeFulltextOptions, ColumnDefaultConstraint, ColumnSchema, FulltextAnalyzer,
+ FulltextOptions, COMMENT_KEY, FULLTEXT_KEY,
};
+use greptime_proto::v1::{Analyzer, ChangeFulltext};
use snafu::ResultExt;
use crate::error::{self, Result};
@@ -93,6 +95,34 @@ pub fn options_from_fulltext(fulltext: &FulltextOptions) -> Result