diff --git a/datafusion/common/Cargo.toml b/datafusion/common/Cargo.toml index 22d728d50a345..55d3bd61308c2 100644 --- a/datafusion/common/Cargo.toml +++ b/datafusion/common/Cargo.toml @@ -47,4 +47,4 @@ ordered-float = "3.0" parquet = { version = "20.0.0", features = ["arrow"], optional = true } pyo3 = { version = "0.16", optional = true } serde_json = "1.0" -sqlparser = { git = "https://github.com/sqlparser-rs/sqlparser-rs", rev = "31ba0012f747c9e2fc551b95fd2ee3bfa46b12e6" } +sqlparser = { git = "https://github.com/sqlparser-rs/sqlparser-rs", rev = "42c5d43b45d3e7a573ac24dd5c927c43bbd3768c" } diff --git a/datafusion/core/Cargo.toml b/datafusion/core/Cargo.toml index 3f84d96180596..92b6acc943757 100644 --- a/datafusion/core/Cargo.toml +++ b/datafusion/core/Cargo.toml @@ -85,7 +85,7 @@ pyo3 = { version = "0.16", optional = true } rand = "0.8" rayon = { version = "1.5", optional = true } smallvec = { version = "1.6", features = ["union"] } -sqlparser = { git = "https://github.com/sqlparser-rs/sqlparser-rs", rev = "31ba0012f747c9e2fc551b95fd2ee3bfa46b12e6" } +sqlparser = { git = "https://github.com/sqlparser-rs/sqlparser-rs", rev = "42c5d43b45d3e7a573ac24dd5c927c43bbd3768c" } tempfile = "3" tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread", "sync", "fs", "parking_lot"] } tokio-stream = "0.1" diff --git a/datafusion/expr/Cargo.toml b/datafusion/expr/Cargo.toml index 6ff3bb8c0e0e2..93b3b6c895f40 100644 --- a/datafusion/expr/Cargo.toml +++ b/datafusion/expr/Cargo.toml @@ -38,4 +38,4 @@ path = "src/lib.rs" ahash = { version = "0.8", default-features = false, features = ["runtime-rng"] } arrow = { version = "20.0.0", features = ["prettyprint"] } datafusion-common = { path = "../common", version = "11.0.0" } -sqlparser = { git = "https://github.com/sqlparser-rs/sqlparser-rs", rev = "31ba0012f747c9e2fc551b95fd2ee3bfa46b12e6" } +sqlparser = { git = "https://github.com/sqlparser-rs/sqlparser-rs", rev = "42c5d43b45d3e7a573ac24dd5c927c43bbd3768c" } diff --git a/datafusion/sql/Cargo.toml b/datafusion/sql/Cargo.toml index 573005836a586..a35f5b87c0c85 100644 --- a/datafusion/sql/Cargo.toml +++ b/datafusion/sql/Cargo.toml @@ -42,5 +42,5 @@ arrow = { version = "20.0.0", features = ["prettyprint"] } datafusion-common = { path = "../common", version = "11.0.0" } datafusion-expr = { path = "../expr", version = "11.0.0" } hashbrown = "0.12" -sqlparser = { git = "https://github.com/sqlparser-rs/sqlparser-rs", rev = "31ba0012f747c9e2fc551b95fd2ee3bfa46b12e6" } +sqlparser = { git = "https://github.com/sqlparser-rs/sqlparser-rs", rev = "42c5d43b45d3e7a573ac24dd5c927c43bbd3768c" } tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread", "sync", "fs", "parking_lot"] } diff --git a/datafusion/sql/src/planner.rs b/datafusion/sql/src/planner.rs index 73ba86180e037..359105a9a4f53 100644 --- a/datafusion/sql/src/planner.rs +++ b/datafusion/sql/src/planner.rs @@ -2026,21 +2026,21 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> { )) } - SQLExpr::Trim { expr, trim_where } => { - let (fun, where_expr) = match trim_where { - Some((TrimWhereField::Leading, expr)) => { - (BuiltinScalarFunction::Ltrim, Some(expr)) + SQLExpr::Trim { expr, trim_where, trim_what } => { + let fun = match trim_where { + Some(TrimWhereField::Leading) => { + BuiltinScalarFunction::Ltrim } - Some((TrimWhereField::Trailing, expr)) => { - (BuiltinScalarFunction::Rtrim, Some(expr)) + Some(TrimWhereField::Trailing) => { + BuiltinScalarFunction::Rtrim } - Some((TrimWhereField::Both, expr)) => { - (BuiltinScalarFunction::Btrim, Some(expr)) + Some(TrimWhereField::Both) => { + BuiltinScalarFunction::Btrim } - None => (BuiltinScalarFunction::Trim, None), + None => BuiltinScalarFunction::Trim }; let arg = self.sql_expr_to_logical_expr(*expr, schema, ctes)?; - let args = match where_expr { + let args = match trim_what { Some(to_trim) => { let to_trim = self.sql_expr_to_logical_expr(*to_trim, schema, ctes)?; vec![arg, to_trim]