diff --git a/src/parser.rs b/src/parser.rs index fbd866b..6e6ef90 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -2014,6 +2014,7 @@ impl Parser { "PIVOT" => self.parse_pivot_pipe_operator()?, "UNPIVOT" => self.parse_unpivot_pipe_operator()?, "WITH" => self.parse_with_pipe_operator()?, + "DISTINCT" => self.construct_node(NodeType::Keyword)?, _ => { return Err(BQ2CSTError::from_token( self.get_token(0)?, diff --git a/src/parser/tests/tests_pipe.rs b/src/parser/tests/tests_pipe.rs index b593e2f..72dfe22 100644 --- a/src/parser/tests/tests_pipe.rs +++ b/src/parser/tests/tests_pipe.rs @@ -597,6 +597,24 @@ right: order: self: DESC (Keyword) - self: col2 (Identifier) +", + 0, + )), + // ----- distinct pipe operator ----- + Box::new(SuccessTestCase::new( + "\ +FROM t |> DISTINCT; +", + "\ +self: |> (PipeStatement) +left: + self: FROM (FromStatement) + expr: + self: t (Identifier) +right: + self: DISTINCT (Keyword) +semicolon: + self: ; (Symbol) ", 0, )),