mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-22 15:04:04 +00:00
Support the string concat operator (#178)
The selected precedence is based on BigQuery documentation, where it is equal to `*` and `/`: https://cloud.google.com/bigquery/docs/reference/standard-sql/operators
This commit is contained in:
parent
5f3c1bda01
commit
00dc490f72
4 changed files with 52 additions and 1 deletions
|
@ -577,6 +577,7 @@ impl Parser {
|
|||
Token::Minus => Some(BinaryOperator::Minus),
|
||||
Token::Mult => Some(BinaryOperator::Multiply),
|
||||
Token::Mod => Some(BinaryOperator::Modulus),
|
||||
Token::StringConcat => Some(BinaryOperator::StringConcat),
|
||||
Token::Div => Some(BinaryOperator::Divide),
|
||||
Token::Word(ref k) => match k.keyword.as_ref() {
|
||||
"AND" => Some(BinaryOperator::And),
|
||||
|
@ -708,7 +709,7 @@ impl Parser {
|
|||
Ok(20)
|
||||
}
|
||||
Token::Plus | Token::Minus => Ok(Self::PLUS_MINUS_PREC),
|
||||
Token::Mult | Token::Div | Token::Mod => Ok(40),
|
||||
Token::Mult | Token::Div | Token::Mod | Token::StringConcat => Ok(40),
|
||||
Token::DoubleColon => Ok(50),
|
||||
_ => Ok(0),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue