Skip to content

Commit bfbd008

Browse files
committed
use parse_set_quantifier
1 parent 370d119 commit bfbd008

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

src/parser/mod.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9970,15 +9970,13 @@ impl<'a> Parser<'a> {
99709970
&mut self,
99719971
operator_name: &str,
99729972
) -> Result<SetQuantifier, ParserError> {
9973-
if self.parse_keywords(&[Keyword::DISTINCT, Keyword::BY, Keyword::NAME]) {
9974-
Ok(SetQuantifier::DistinctByName)
9975-
} else if self.parse_keyword(Keyword::DISTINCT) {
9976-
Ok(SetQuantifier::Distinct)
9977-
} else {
9978-
Err(ParserError::ParserError(format!(
9973+
let quantifier = self.parse_set_quantifier(&Some(SetOperator::Intersect));
9974+
match quantifier {
9975+
SetQuantifier::Distinct | SetQuantifier::DistinctByName => Ok(quantifier),
9976+
_ => Err(ParserError::ParserError(format!(
99799977
"{} pipe operator requires DISTINCT modifier",
99809978
operator_name
9981-
)))
9979+
))),
99829980
}
99839981
}
99849982

0 commit comments

Comments
 (0)