Skip to content

Commit 5002d4f

Browse files
authored
Make UNPIVOT conformance tests pass (#132)
This PR includes the required changes to ensure the current UNPIVOT conformance tests pass.
1 parent e89541d commit 5002d4f

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

partiql-parser/src/parse/partiql.lalrpop

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,12 @@ TableBaseReference: ast::FromLetAst = {
264264

265265
#[inline]
266266
TableUnpivot: ast::FromLetAst = {
267-
<lo:@L> "UNPIVOT" <e:ExprQuery> "AS"? <ident_as:SymbolPrimitive> "AT" <ident_at:SymbolPrimitive> <hi:@R> => {
267+
<lo:@L> "UNPIVOT" <e:ExprQuery> <as_ident:AsIdent?> <at_ident:AtIdent?> <hi:@R> => {
268268
ast::FromLet {
269269
expr: e,
270270
kind: ast::FromLetKind::Unpivot,
271-
as_alias: Some(ident_as),
272-
at_alias: Some(ident_at),
271+
as_alias: as_ident,
272+
at_alias: at_ident,
273273
by_alias: None,
274274
}.ast(lo..hi)
275275
}
@@ -1156,6 +1156,14 @@ SymbolPrimitive: ast::SymbolPrimitive = {
11561156
},
11571157
};
11581158

1159+
AsIdent: ast::SymbolPrimitive = {
1160+
"AS" <SymbolPrimitive>
1161+
}
1162+
1163+
AtIdent: ast::SymbolPrimitive = {
1164+
"AT" <SymbolPrimitive>
1165+
}
1166+
11591167
// ------------------------------------------------------------------------------ //
11601168
// //
11611169
// Lexer //

0 commit comments

Comments
 (0)