Skip to content

Commit 662717c

Browse files
committed
Revert @sigma table factor
1 parent 9c6ec54 commit 662717c

File tree

5 files changed

+0
-73
lines changed

5 files changed

+0
-73
lines changed

src/ast/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,6 @@ pub enum Expr {
462462
Identifier(Ident),
463463
/// Multi-part identifier, e.g. `table_alias.column` or `schema.table.col`
464464
CompoundIdentifier(Vec<Ident>),
465-
/// A reference to a Sigma scalar value, e.g. `@sigma.my_parameter`.
466-
SigmaParameter(Ident),
467465
/// Access data nested in a value containing semi-structured data, such as
468466
/// the `VARIANT` type on Snowflake. for example `src:customer[0].name`.
469467
///
@@ -950,7 +948,6 @@ impl fmt::Display for Expr {
950948
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
951949
match self {
952950
Expr::Identifier(s) => write!(f, "{s}"),
953-
Expr::SigmaParameter(s) => write!(f, "@sigma.{s}"),
954951
Expr::MapAccess { column, keys } => {
955952
write!(f, "{column}{}", display_separated(keys, ""))
956953
}

src/ast/query.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -916,11 +916,6 @@ pub enum TableFactor {
916916
/// [Partition selection](https://dev.mysql.com/doc/refman/8.0/en/partitioning-selection.html), supported by MySQL.
917917
partitions: Vec<Ident>,
918918
},
919-
/// A reference to an element in a Sigma workbook.
920-
SigmaElement {
921-
element: Ident,
922-
alias: Option<TableAlias>,
923-
},
924919
Derived {
925920
lateral: bool,
926921
subquery: Box<Query>,
@@ -1317,13 +1312,6 @@ impl fmt::Display for TableFactor {
13171312
}
13181313
Ok(())
13191314
}
1320-
TableFactor::SigmaElement { element, alias } => {
1321-
write!(f, "@sigma.{element}")?;
1322-
if let Some(alias) = alias {
1323-
write!(f, " AS {alias}")?;
1324-
}
1325-
Ok(())
1326-
}
13271315
TableFactor::Derived {
13281316
lateral,
13291317
subquery,

src/keywords.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,6 @@ define_keywords!(
655655
SETTINGS,
656656
SHARE,
657657
SHOW,
658-
SIGMA,
659658
SIMILAR,
660659
SKIP,
661660
SLOW,

src/parser/mod.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,10 +1152,6 @@ impl<'a> Parser<'a> {
11521152
}, // End of Token::Word
11531153
// array `[1, 2, 3]`
11541154
Token::LBracket => self.parse_array_expr(false),
1155-
Token::AtSign if self.parse_keyword(Keyword::SIGMA) => {
1156-
self.expect_token(&Token::Period)?;
1157-
Ok(Expr::SigmaParameter(self.parse_identifier(false)?))
1158-
}
11591155
tok @ Token::Minus | tok @ Token::Plus => {
11601156
let op = if tok == Token::Plus {
11611157
UnaryOperator::Plus
@@ -9152,7 +9148,6 @@ impl<'a> Parser<'a> {
91529148
match &mut table_and_joins.relation {
91539149
TableFactor::Derived { alias, .. }
91549150
| TableFactor::Table { alias, .. }
9155-
| TableFactor::SigmaElement { alias, .. }
91569151
| TableFactor::Function { alias, .. }
91579152
| TableFactor::UNNEST { alias, .. }
91589153
| TableFactor::JsonTable { alias, .. }
@@ -9267,11 +9262,6 @@ impl<'a> Parser<'a> {
92679262
columns,
92689263
alias,
92699264
})
9270-
} else if self.parse_sigma_directive() {
9271-
self.expect_token(&Token::Period)?;
9272-
let element = self.parse_identifier(true)?;
9273-
let alias = self.parse_optional_table_alias(keywords::RESERVED_FOR_TABLE_ALIAS)?;
9274-
Ok(TableFactor::SigmaElement { element, alias })
92759265
} else {
92769266
let name = self.parse_object_name(true)?;
92779267

@@ -9334,15 +9324,6 @@ impl<'a> Parser<'a> {
93349324
}
93359325
}
93369326

9337-
pub fn parse_sigma_directive(&mut self) -> bool {
9338-
self.maybe_parse(|p| {
9339-
p.expect_token(&Token::AtSign)?;
9340-
p.expect_keyword(Keyword::SIGMA)?;
9341-
Ok(())
9342-
})
9343-
.is_some()
9344-
}
9345-
93469327
fn parse_match_recognize(&mut self, table: TableFactor) -> Result<TableFactor, ParserError> {
93479328
self.expect_token(&Token::LParen)?;
93489329

tests/sqlparser_sigma.rs

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)