Skip to content

Commit 49ff818

Browse files
committed
feat: Support escaped strings
1 parent 35535b0 commit 49ff818

7 files changed

Lines changed: 14 additions & 5 deletions

File tree

ballista/rust/client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ datafusion = { path = "../../../datafusion/core", version = "7.0.0" }
3535
futures = "0.3"
3636
log = "0.4"
3737
parking_lot = "0.12"
38-
sqlparser = { git = 'https://github.com/cube-js/sqlparser-rs.git', rev = "47a7b66c64417662c6c30f0decdb0a900fc97a56" }
38+
sqlparser = { git = 'https://github.com/cube-js/sqlparser-rs.git', rev = "92ac0de2634cac686d29035593eb57df36606396" }
3939
tempfile = "3"
4040
tokio = "1.0"
4141

ballista/rust/core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ parse_arg = "0.1.3"
4949
prost = "0.9"
5050
prost-types = "0.9"
5151
serde = { version = "1", features = ["derive"] }
52-
sqlparser = { git = 'https://github.com/cube-js/sqlparser-rs.git', rev = "47a7b66c64417662c6c30f0decdb0a900fc97a56" }
52+
sqlparser = { git = 'https://github.com/cube-js/sqlparser-rs.git', rev = "92ac0de2634cac686d29035593eb57df36606396" }
5353
tokio = "1.0"
5454
tonic = "0.6"
5555
uuid = { version = "0.8", features = ["v4"] }

datafusion/common/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ cranelift-module = { version = "0.82.0", optional = true }
4444
ordered-float = "2.10"
4545
parquet = { git = 'https://github.com/cube-js/arrow-rs.git', rev = "52d28cdd32e7b7fb9997a2e6bb187f0a64392573", features = ["arrow"], optional = true }
4646
pyo3 = { version = "0.16", optional = true }
47-
sqlparser = { git = 'https://github.com/cube-js/sqlparser-rs.git', rev = "47a7b66c64417662c6c30f0decdb0a900fc97a56" }
47+
sqlparser = { git = 'https://github.com/cube-js/sqlparser-rs.git', rev = "92ac0de2634cac686d29035593eb57df36606396" }

datafusion/core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pin-project-lite= "^0.2.7"
7878
pyo3 = { version = "0.16", optional = true }
7979
rand = "0.8"
8080
smallvec = { version = "1.6", features = ["union"] }
81-
sqlparser = { git = 'https://github.com/cube-js/sqlparser-rs.git', rev = "47a7b66c64417662c6c30f0decdb0a900fc97a56" }
81+
sqlparser = { git = 'https://github.com/cube-js/sqlparser-rs.git', rev = "92ac0de2634cac686d29035593eb57df36606396" }
8282
tempfile = "3"
8383
tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread", "sync", "fs", "parking_lot"] }
8484
tokio-stream = "0.1"

datafusion/core/src/sql/planner.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,6 +1589,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
15891589
match sql {
15901590
SQLExpr::Value(Value::Number(n, _)) => parse_sql_number(&n),
15911591
SQLExpr::Value(Value::SingleQuotedString(ref s)) => Ok(lit(s.clone())),
1592+
SQLExpr::Value(Value::EscapedStringLiteral(ref s)) => Ok(lit(s.clone())),
15921593
SQLExpr::Value(Value::Boolean(n)) => Ok(lit(n)),
15931594
SQLExpr::Value(Value::Null) => Ok(Expr::Literal(ScalarValue::Utf8(None))),
15941595
SQLExpr::Extract { field, expr } => Ok(Expr::ScalarFunction {

datafusion/core/tests/sql/expr.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,14 @@ async fn test_substring_expr() -> Result<()> {
601601
Ok(())
602602
}
603603

604+
#[tokio::test]
605+
async fn test_like() -> Result<()> {
606+
test_expression!("'test' LIKE e'%'", "true");
607+
test_expression!("'payment_p2020_01' LIKE E'payment\\_p2020\\_01'", "true");
608+
609+
Ok(())
610+
}
611+
604612
#[tokio::test]
605613
async fn test_is_boolean() -> Result<()> {
606614
test_expression!("true IS TRUE", "true");

datafusion/expr/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ path = "src/lib.rs"
3838
ahash = { version = "0.7", default-features = false }
3939
arrow = { git = 'https://github.com/cube-js/arrow-rs.git', rev = "52d28cdd32e7b7fb9997a2e6bb187f0a64392573", features = ["prettyprint"] }
4040
datafusion-common = { path = "../common", version = "7.0.0" }
41-
sqlparser = { git = 'https://github.com/cube-js/sqlparser-rs.git', rev = "47a7b66c64417662c6c30f0decdb0a900fc97a56" }
41+
sqlparser = { git = 'https://github.com/cube-js/sqlparser-rs.git', rev = "92ac0de2634cac686d29035593eb57df36606396" }

0 commit comments

Comments
 (0)