mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-12-23 11:12:51 +00:00
Cargo fmt
This commit is contained in:
parent
43a6ab1885
commit
0547fe8ffb
3 changed files with 21 additions and 6 deletions
|
|
@ -17,7 +17,8 @@ use alloc::{boxed::Box, format, string::ToString, vec, vec::Vec};
|
|||
|
||||
use crate::{
|
||||
ast::{
|
||||
Merge, MergeAction, MergeClause, MergeClauseKind, MergeInsertExpr, MergeInsertKind, MergeUpdateExpr, ObjectName, ObjectNamePart, OutputClause, SetExpr, Statement
|
||||
Merge, MergeAction, MergeClause, MergeClauseKind, MergeInsertExpr, MergeInsertKind,
|
||||
MergeUpdateExpr, ObjectName, ObjectNamePart, OutputClause, SetExpr, Statement,
|
||||
},
|
||||
dialect::{BigQueryDialect, GenericDialect, MySqlDialect},
|
||||
keywords::Keyword,
|
||||
|
|
@ -211,7 +212,10 @@ impl Parser<'_> {
|
|||
Ok(clauses)
|
||||
}
|
||||
|
||||
fn parse_merge_clause_insert_columns(&mut self, allow_empty: bool) -> Result<Vec<ObjectName>, ParserError> {
|
||||
fn parse_merge_clause_insert_columns(
|
||||
&mut self,
|
||||
allow_empty: bool,
|
||||
) -> Result<Vec<ObjectName>, ParserError> {
|
||||
if self.dialect.supports_merge_insert_qualified_columns() {
|
||||
self.parse_parenthesized_qualified_column_list(IsOptional::Optional, allow_empty)
|
||||
} else {
|
||||
|
|
@ -228,7 +232,8 @@ impl Parser<'_> {
|
|||
allow_empty: bool,
|
||||
) -> Result<Vec<ObjectName>, ParserError> {
|
||||
self.parse_parenthesized_column_list_inner(optional, allow_empty, |p| {
|
||||
p.parse_identifier().map(|ident| ObjectName(vec![ObjectNamePart::Identifier(ident)]))
|
||||
p.parse_identifier()
|
||||
.map(|ident| ObjectName(vec![ObjectNamePart::Identifier(ident)]))
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1920,7 +1920,10 @@ fn parse_merge() {
|
|||
predicate: Some(Expr::value(number("1"))),
|
||||
action: MergeAction::Insert(MergeInsertExpr {
|
||||
insert_token: AttachedToken::empty(),
|
||||
columns: vec![Ident::new("product").into(), Ident::new("quantity").into(),],
|
||||
columns: vec![
|
||||
Ident::new("product").into(),
|
||||
Ident::new("quantity").into(),
|
||||
],
|
||||
kind_token: AttachedToken::empty(),
|
||||
kind: MergeInsertKind::Row,
|
||||
insert_predicate: None,
|
||||
|
|
@ -1932,7 +1935,10 @@ fn parse_merge() {
|
|||
predicate: None,
|
||||
action: MergeAction::Insert(MergeInsertExpr {
|
||||
insert_token: AttachedToken::empty(),
|
||||
columns: vec![Ident::new("product").into(), Ident::new("quantity").into(),],
|
||||
columns: vec![
|
||||
Ident::new("product").into(),
|
||||
Ident::new("quantity").into(),
|
||||
],
|
||||
kind_token: AttachedToken::empty(),
|
||||
kind: MergeInsertKind::Row,
|
||||
insert_predicate: None,
|
||||
|
|
|
|||
|
|
@ -9929,7 +9929,11 @@ fn parse_merge() {
|
|||
predicate: None,
|
||||
action: MergeAction::Insert(MergeInsertExpr {
|
||||
insert_token: AttachedToken::empty(),
|
||||
columns: vec![Ident::new("A").into(), Ident::new("B").into(), Ident::new("C").into()],
|
||||
columns: vec![
|
||||
Ident::new("A").into(),
|
||||
Ident::new("B").into(),
|
||||
Ident::new("C").into()
|
||||
],
|
||||
kind_token: AttachedToken::empty(),
|
||||
kind: MergeInsertKind::Values(Values {
|
||||
value_keyword: false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue