File tree 2 files changed +34
-0
lines changed
2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -651,6 +651,12 @@ pub enum Statement {
651
651
unique : bool ,
652
652
if_not_exists : bool ,
653
653
} ,
654
+ // CubeStore extension.
655
+ CreatePartitionedIndex {
656
+ name : ObjectName ,
657
+ columns : Vec < ColumnDef > ,
658
+ if_not_exists : bool ,
659
+ } ,
654
660
/// ALTER TABLE
655
661
AlterTable {
656
662
/// Table name
@@ -1276,6 +1282,19 @@ impl fmt::Display for Statement {
1276
1282
}
1277
1283
write ! ( f, "AS {}" , statement)
1278
1284
}
1285
+ Statement :: CreatePartitionedIndex {
1286
+ name,
1287
+ columns,
1288
+ if_not_exists,
1289
+ } => {
1290
+ write ! (
1291
+ f,
1292
+ "CREATE PARTITIONED INDEX{} {}({})" ,
1293
+ if * if_not_exists { " IF NOT EXISTS" } else { "" } ,
1294
+ name,
1295
+ display_comma_separated( & columns)
1296
+ )
1297
+ }
1279
1298
}
1280
1299
}
1281
1300
}
Original file line number Diff line number Diff line change @@ -1267,6 +1267,8 @@ impl<'a> Parser<'a> {
1267
1267
self . parse_create_virtual_table ( )
1268
1268
} else if self . parse_keyword ( Keyword :: SCHEMA ) {
1269
1269
self . parse_create_schema ( )
1270
+ } else if self . parse_keywords ( & [ Keyword :: PARTITIONED , Keyword :: INDEX ] ) {
1271
+ self . parse_create_partitioned_index ( )
1270
1272
} else {
1271
1273
self . expected ( "an object type after CREATE" , self . peek_token ( ) )
1272
1274
}
@@ -1433,6 +1435,19 @@ impl<'a> Parser<'a> {
1433
1435
} )
1434
1436
}
1435
1437
1438
+ pub fn parse_create_partitioned_index ( & mut self ) -> Result < Statement , ParserError > {
1439
+ let if_not_exists = self . parse_keywords ( & [ Keyword :: IF , Keyword :: NOT , Keyword :: EXISTS ] ) ;
1440
+ let name = self . parse_object_name ( ) ?;
1441
+ self . expect_token ( & Token :: LParen ) ?;
1442
+ let columns = self . parse_comma_separated ( Parser :: parse_column_def) ?;
1443
+ self . expect_token ( & Token :: RParen ) ?;
1444
+ Ok ( Statement :: CreatePartitionedIndex {
1445
+ name,
1446
+ columns,
1447
+ if_not_exists,
1448
+ } )
1449
+ }
1450
+
1436
1451
pub fn parse_create_index ( & mut self , unique : bool ) -> Result < Statement , ParserError > {
1437
1452
let if_not_exists = self . parse_keywords ( & [ Keyword :: IF , Keyword :: NOT , Keyword :: EXISTS ] ) ;
1438
1453
let index_name = self . parse_object_name ( ) ?;
You can’t perform that action at this time.
0 commit comments