@@ -34,7 +34,7 @@ use table::requests::{
3434} ;
3535
3636use crate :: error:: {
37- InvalidColumnDefSnafu , InvalidSetFulltextOptionRequestSnafu ,
37+ InvalidColumnDefSnafu , InvalidIndexOptionSnafu , InvalidSetFulltextOptionRequestSnafu ,
3838 InvalidSetSkippingIndexOptionRequestSnafu , InvalidSetTableOptionRequestSnafu ,
3939 InvalidUnsetTableOptionRequestSnafu , MissingAlterIndexOptionSnafu , MissingFieldSnafu ,
4040 MissingTimestampColumnSnafu , Result , UnknownLocationTypeSnafu ,
@@ -126,18 +126,21 @@ pub fn alter_expr_to_request(table_id: TableId, expr: AlterTableExpr) -> Result<
126126 api:: v1:: set_index:: Options :: Fulltext ( f) => AlterKind :: SetIndex {
127127 options : SetIndexOptions :: Fulltext {
128128 column_name : f. column_name . clone ( ) ,
129- options : FulltextOptions {
130- enable : f. enable ,
131- analyzer : as_fulltext_option_analyzer (
129+ options : FulltextOptions :: new (
130+ f. enable ,
131+ as_fulltext_option_analyzer (
132132 Analyzer :: try_from ( f. analyzer )
133133 . context ( InvalidSetFulltextOptionRequestSnafu ) ?,
134134 ) ,
135- case_sensitive : f. case_sensitive ,
136- backend : as_fulltext_option_backend (
135+ f. case_sensitive ,
136+ as_fulltext_option_backend (
137137 PbFulltextBackend :: try_from ( f. backend )
138138 . context ( InvalidSetFulltextOptionRequestSnafu ) ?,
139139 ) ,
140- } ,
140+ f. granularity as u32 ,
141+ f. false_positive_rate ,
142+ )
143+ . context ( InvalidIndexOptionSnafu ) ?,
141144 } ,
142145 } ,
143146 api:: v1:: set_index:: Options :: Inverted ( i) => AlterKind :: SetIndex {
@@ -148,13 +151,15 @@ pub fn alter_expr_to_request(table_id: TableId, expr: AlterTableExpr) -> Result<
148151 api:: v1:: set_index:: Options :: Skipping ( s) => AlterKind :: SetIndex {
149152 options : SetIndexOptions :: Skipping {
150153 column_name : s. column_name ,
151- options : SkippingIndexOptions {
152- granularity : s. granularity as u32 ,
153- index_type : as_skipping_index_type (
154+ options : SkippingIndexOptions :: new (
155+ s. granularity as u32 ,
156+ s. false_positive_rate ,
157+ as_skipping_index_type (
154158 PbSkippingIndexType :: try_from ( s. skipping_index_type )
155159 . context ( InvalidSetSkippingIndexOptionRequestSnafu ) ?,
156160 ) ,
157- } ,
161+ )
162+ . context ( InvalidIndexOptionSnafu ) ?,
158163 } ,
159164 } ,
160165 } ,
0 commit comments