@@ -195,9 +195,6 @@ const EOF_TOKEN: TokenWithSpan = TokenWithSpan {
195195 },
196196};
197197
198- // Error message constant for pipe operators that require DISTINCT
199- const EXPECTED_FUNCTION_CALL_MSG: &str = "Expected function call after CALL";
200-
201198/// Composite types declarations using angle brackets syntax can be arbitrary
202199/// nested such that the following declaration is possible:
203200/// `ARRAY<ARRAY<INT>>`
@@ -9969,15 +9966,19 @@ impl<'a> Parser<'a> {
99699966 }
99709967
99719968 /// Parse set quantifier for pipe operators that require DISTINCT (INTERSECT, EXCEPT)
9972- fn parse_distinct_required_set_quantifier(&mut self, operator_name: &str) -> Result<SetQuantifier, ParserError> {
9969+ fn parse_distinct_required_set_quantifier(
9970+ &mut self,
9971+ operator_name: &str,
9972+ ) -> Result<SetQuantifier, ParserError> {
99739973 if self.parse_keywords(&[Keyword::DISTINCT, Keyword::BY, Keyword::NAME]) {
99749974 Ok(SetQuantifier::DistinctByName)
99759975 } else if self.parse_keyword(Keyword::DISTINCT) {
99769976 Ok(SetQuantifier::Distinct)
99779977 } else {
9978- Err(ParserError::ParserError(
9979- format!("{} pipe operator requires DISTINCT modifier", operator_name),
9980- ))
9978+ Err(ParserError::ParserError(format!(
9979+ "{} pipe operator requires DISTINCT modifier",
9980+ operator_name
9981+ )))
99819982 }
99829983 }
99839984
@@ -11215,7 +11216,8 @@ impl<'a> Parser<'a> {
1121511216 });
1121611217 }
1121711218 Keyword::INTERSECT => {
11218- let set_quantifier = self.parse_distinct_required_set_quantifier("INTERSECT")?;
11219+ let set_quantifier =
11220+ self.parse_distinct_required_set_quantifier("INTERSECT")?;
1121911221 let queries = self.parse_pipe_operator_queries()?;
1122011222 pipe_operators.push(PipeOperator::Intersect {
1122111223 set_quantifier,
@@ -11239,7 +11241,7 @@ impl<'a> Parser<'a> {
1123911241 pipe_operators.push(PipeOperator::Call { function, alias });
1124011242 } else {
1124111243 return Err(ParserError::ParserError(
11242- EXPECTED_FUNCTION_CALL_MSG .to_string(),
11244+ "Expected function call after CALL" .to_string(),
1124311245 ));
1124411246 }
1124511247 }
0 commit comments