Skip to content

Commit

Permalink
use sqlparser 0.21
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrove authored and alamb committed Aug 19, 2022
1 parent 292ff5b commit 932d990
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion datafusion/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "42c5d43b45d3e7a573ac24dd5c927c43bbd3768c" }
sqlparser = "0.21"
2 changes: 1 addition & 1 deletion datafusion/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "42c5d43b45d3e7a573ac24dd5c927c43bbd3768c" }
sqlparser = "0.21"
tempfile = "3"
tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread", "sync", "fs", "parking_lot"] }
tokio-stream = "0.1"
Expand Down
3 changes: 0 additions & 3 deletions datafusion/core/tests/sql/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1322,9 +1322,6 @@ async fn nested_subquery() -> Result<()> {
}

#[tokio::test]
#[ignore]
// this will be re-instated once we are using a later rev of sqlparser that has a fix for this
// regression - see https://github.com/apache/arrow-datafusion/issues/3192 for more info
async fn like_nlike_with_null_lt() {
let ctx = SessionContext::new();
let sql = "SELECT column1 like NULL as col_null, NULL like column1 as null_col from (values('a'), ('b'), (NULL)) as t";
Expand Down
2 changes: 1 addition & 1 deletion datafusion/expr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "42c5d43b45d3e7a573ac24dd5c927c43bbd3768c" }
sqlparser = "0.21"
2 changes: 1 addition & 1 deletion datafusion/sql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "42c5d43b45d3e7a573ac24dd5c927c43bbd3768c" }
sqlparser = "0.21"
tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread", "sync", "fs", "parking_lot"] }
7 changes: 1 addition & 6 deletions datafusion/sql/src/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1941,12 +1941,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
Ok(Expr::BinaryExpr {
left: Box::new(self.sql_expr_to_logical_expr(*expr, schema, ctes)?),
op: if negated { Operator::NotLike } else { Operator::Like },
right: match *pattern {
Value::SingleQuotedString(s) | Value::DoubleQuotedString(s) => {
Ok(Box::new(Expr::Literal(ScalarValue::Utf8(Some(s)))))
}
_ => Err(DataFusionError::NotImplemented("Unsupported syntax for LIKE pattern ".to_string()))
}?
right: Box::new(self.sql_expr_to_logical_expr(*pattern, schema, ctes)?),
})
}
}
Expand Down

0 comments on commit 932d990

Please sign in to comment.