diff --git a/src/ast/mod.rs b/src/ast/mod.rs index f02461e0..32c7f6e9 100644 --- a/src/ast/mod.rs +++ b/src/ast/mod.rs @@ -40,13 +40,15 @@ pub use self::ddl::{ pub use self::dml::{Delete, Insert}; pub use self::operator::{BinaryOperator, UnaryOperator}; pub use self::query::{ - Cte, CteAsMaterialized, Distinct, ExceptSelectItem, ExcludeSelectItem, Fetch, ForClause, - ForJson, ForXml, GroupByExpr, IdentWithAlias, IlikeSelectItem, Join, JoinConstraint, - JoinOperator, JsonTableColumn, JsonTableColumnErrorHandling, LateralView, LockClause, LockType, - NamedWindowDefinition, NonBlock, Offset, OffsetRows, OrderByExpr, Query, RenameSelectItem, - ReplaceSelectElement, ReplaceSelectItem, Select, SelectInto, SelectItem, SetExpr, SetOperator, - SetQuantifier, Table, TableAlias, TableFactor, TableVersion, TableWithJoins, Top, TopQuantity, - ValueTableMode, Values, WildcardAdditionalOptions, With, + AfterMatchSkip, Cte, CteAsMaterialized, Distinct, EmptyMatchesMode, ExceptSelectItem, + ExcludeSelectItem, Fetch, ForClause, ForJson, ForXml, GroupByExpr, IdentWithAlias, + IlikeSelectItem, Join, JoinConstraint, JoinOperator, JsonTableColumn, + JsonTableColumnErrorHandling, LateralView, LockClause, LockType, MatchRecognizePattern, + MatchRecognizeSymbol, Measure, NamedWindowDefinition, NonBlock, Offset, OffsetRows, + OrderByExpr, Query, RenameSelectItem, RepetitionQuantifier, ReplaceSelectElement, + ReplaceSelectItem, RowsPerMatch, Select, SelectInto, SelectItem, SetExpr, SetOperator, + SetQuantifier, SymbolDefinition, Table, TableAlias, TableFactor, TableVersion, TableWithJoins, + Top, TopQuantity, ValueTableMode, Values, WildcardAdditionalOptions, With, }; pub use self::value::{ escape_quoted_string, DateTimeField, DollarQuotedString, TrimWhereField, Value, diff --git a/src/ast/query.rs b/src/ast/query.rs index 391ef51d..5f5bca4c 100644 --- a/src/ast/query.rs +++ b/src/ast/query.rs @@ -852,6 +852,238 @@ pub enum TableFactor { columns: Vec, alias: Option, }, + /// A `MATCH_RECOGNIZE` operation on a table. + /// + /// See . + MatchRecognize { + table: Box, + /// `PARTITION BY [, ... ]` + partition_by: Vec, + /// `ORDER BY [, ... ]` + order_by: Vec, + /// `MEASURES [AS] [, ... ]` + measures: Vec, + /// `ONE ROW PER MATCH | ALL ROWS PER MATCH [