mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-31 03:07:20 +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
|
@ -665,6 +665,21 @@ fn parse_in_subquery() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_string_agg() {
|
||||
let sql = "SELECT a || b";
|
||||
|
||||
let select = verified_only_select(sql);
|
||||
assert_eq!(
|
||||
SelectItem::UnnamedExpr(Expr::BinaryOp {
|
||||
left: Box::new(Expr::Identifier(Ident::new("a"))),
|
||||
op: BinaryOperator::StringConcat,
|
||||
right: Box::new(Expr::Identifier(Ident::new("b"))),
|
||||
}),
|
||||
select.projection[0]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_between() {
|
||||
fn chk(negated: bool) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue