Skip to content

Commit

Permalink
Fix typo (gluesql#1020)
Browse files Browse the repository at this point in the history
  • Loading branch information
ever0de committed Nov 26, 2022
1 parent a3e3721 commit f3094f2
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions core/src/ast_builder/select/group_by.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ mod tests {
#[test]
fn group_by() {
// select node -> group by node -> build
let acutal = table("Foo").select().group_by("a").build();
let actual = table("Foo").select().group_by("a").build();
let expected = "SELECT * FROM Foo GROUP BY a";
test(acutal, expected);
test(actual, expected);

// join node -> group by node -> build
let actual = table("Foo").select().join("Bar").group_by("b").build();
Expand Down
4 changes: 2 additions & 2 deletions core/src/ast_builder/select/join/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ mod tests {
test(actual, expected);

// select node -> join node -> project node
let acutal = table("Orders")
let actual = table("Orders")
.select()
.join("Customers")
.project(vec![
Expand All @@ -257,7 +257,7 @@ mod tests {
SELECT Orders.OrderID, Customers.CustomerName, Orders.OrderDate
FROM Orders INNER JOIN Customers
";
test(acutal, expected);
test(actual, expected);
}

#[test]
Expand Down
4 changes: 2 additions & 2 deletions core/src/ast_builder/select/order_by.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ mod tests {
test(actual, expected);

// filter node -> order by node -> build
let actaul = table("Foo")
let actual = table("Foo")
.select()
.filter("id > 10")
.filter("id < 20")
Expand All @@ -192,7 +192,7 @@ mod tests {
SELECT * FROM Foo
WHERE id > 10 AND id < 20
ORDER BY id ASC";
test(actaul, expected);
test(actual, expected);

// join node -> order by node -> build
let actual = table("Foo")
Expand Down
4 changes: 2 additions & 2 deletions core/src/executor/alter/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub fn validate(column_def: &ColumnDef) -> Result<()> {
}

pub fn validate_column_names(column_defs: &[ColumnDef]) -> Result<()> {
let duplicate_colum_name = column_defs
let duplicate_column_name = column_defs
.iter()
.enumerate()
.find(|(i, base_column)| {
Expand All @@ -52,7 +52,7 @@ pub fn validate_column_names(column_defs: &[ColumnDef]) -> Result<()> {
})
.map(|(_, column)| &column.name);

match duplicate_colum_name {
match duplicate_column_name {
Some(v) => Err(AlterError::DuplicateColumnName(v.to_owned()).into()),
None => Ok(()),
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/translate/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use {
super::{
ast_literal::{translate_ast_literal, translate_datetime_field},
data_type::translate_data_type,
function::{translate_cast, translate_extract, translate_function, translate_positon},
function::{translate_cast, translate_extract, translate_function, translate_position},
operator::{translate_binary_operator, translate_unary_operator},
translate_idents, translate_query, TranslateError,
},
Expand Down Expand Up @@ -140,7 +140,7 @@ pub fn translate_expr(sql_expr: &SqlExpr) -> Result<Expr> {
obj: translate_expr(obj).map(Box::new)?,
indexes: indexes.iter().map(translate_expr).collect::<Result<_>>()?,
}),
SqlExpr::Position { expr, r#in } => translate_positon(expr, r#in),
SqlExpr::Position { expr, r#in } => translate_position(expr, r#in),
SqlExpr::Interval {
value,
leading_field,
Expand Down
2 changes: 1 addition & 1 deletion core/src/translate/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub fn translate_trim(
})))
}

pub fn translate_positon(sub_expr: &SqlExpr, from_expr: &SqlExpr) -> Result<Expr> {
pub fn translate_position(sub_expr: &SqlExpr, from_expr: &SqlExpr) -> Result<Expr> {
let from_expr = translate_expr(from_expr)?;
let sub_expr = translate_expr(sub_expr)?;
Ok(Expr::Function(Box::new(Function::Position {
Expand Down
2 changes: 1 addition & 1 deletion core/src/translate/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ fn translate_select(sql_select: &SqlSelect) -> Result<Select> {
None => TableWithJoins {
relation: TableFactor::Series {
alias: TableAlias {
name: "Seires".to_owned(),
name: "Series".to_owned(),
columns: Vec::new(),
},
size: Expr::Literal(AstLiteral::Number(1.into())),
Expand Down

0 comments on commit f3094f2

Please sign in to comment.