mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-31 12:13:45 +00:00
chore: fix typo (#822)
This commit is contained in:
parent
b838415276
commit
2285bb44ba
3 changed files with 7 additions and 7 deletions
|
@ -563,16 +563,16 @@ impl fmt::Display for ReplaceSelectItem {
|
||||||
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
|
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
|
||||||
pub struct ReplaceSelectElement {
|
pub struct ReplaceSelectElement {
|
||||||
pub expr: Expr,
|
pub expr: Expr,
|
||||||
pub colum_name: Ident,
|
pub column_name: Ident,
|
||||||
pub as_keyword: bool,
|
pub as_keyword: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for ReplaceSelectElement {
|
impl fmt::Display for ReplaceSelectElement {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
if self.as_keyword {
|
if self.as_keyword {
|
||||||
write!(f, "{} AS {}", self.expr, self.colum_name)
|
write!(f, "{} AS {}", self.expr, self.column_name)
|
||||||
} else {
|
} else {
|
||||||
write!(f, "{} {}", self.expr, self.colum_name)
|
write!(f, "{} {}", self.expr, self.column_name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6277,7 +6277,7 @@ impl<'a> Parser<'a> {
|
||||||
let ident = self.parse_identifier()?;
|
let ident = self.parse_identifier()?;
|
||||||
Ok(ReplaceSelectElement {
|
Ok(ReplaceSelectElement {
|
||||||
expr,
|
expr,
|
||||||
colum_name: ident,
|
column_name: ident,
|
||||||
as_keyword,
|
as_keyword,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -358,7 +358,7 @@ fn test_select_wildcard_with_replace() {
|
||||||
opt_replace: Some(ReplaceSelectItem {
|
opt_replace: Some(ReplaceSelectItem {
|
||||||
items: vec![Box::new(ReplaceSelectElement {
|
items: vec![Box::new(ReplaceSelectElement {
|
||||||
expr: Expr::Value(Value::SingleQuotedString("widget".to_owned())),
|
expr: Expr::Value(Value::SingleQuotedString("widget".to_owned())),
|
||||||
colum_name: Ident::new("item_name"),
|
column_name: Ident::new("item_name"),
|
||||||
as_keyword: true,
|
as_keyword: true,
|
||||||
})],
|
})],
|
||||||
}),
|
}),
|
||||||
|
@ -384,7 +384,7 @@ fn test_select_wildcard_with_replace() {
|
||||||
false,
|
false,
|
||||||
))),
|
))),
|
||||||
},
|
},
|
||||||
colum_name: Ident::new("quantity"),
|
column_name: Ident::new("quantity"),
|
||||||
as_keyword: true,
|
as_keyword: true,
|
||||||
}),
|
}),
|
||||||
Box::new(ReplaceSelectElement {
|
Box::new(ReplaceSelectElement {
|
||||||
|
@ -392,7 +392,7 @@ fn test_select_wildcard_with_replace() {
|
||||||
expr: Expr::Value(Value::Number("3".to_string(), false)),
|
expr: Expr::Value(Value::Number("3".to_string(), false)),
|
||||||
#[cfg(feature = "bigdecimal")]
|
#[cfg(feature = "bigdecimal")]
|
||||||
expr: Expr::Value(Value::Number(BigDecimal::from_str("3").unwrap(), false)),
|
expr: Expr::Value(Value::Number(BigDecimal::from_str("3").unwrap(), false)),
|
||||||
colum_name: Ident::new("order_id"),
|
column_name: Ident::new("order_id"),
|
||||||
as_keyword: true,
|
as_keyword: true,
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue