Skip to content

Commit 49acad5

Browse files
authored
feat(cubesql): Strings with Unicode Escapes (#7756)
1 parent 3cf12c5 commit 49acad5

File tree

4 files changed

+62
-16
lines changed

4 files changed

+62
-16
lines changed

packages/cubejs-backend-native/Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/cubesql/Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/cubesql/cubesql/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ homepage = "https://cube.dev"
1010

1111
[dependencies]
1212
arc-swap = "1"
13-
datafusion = { git = 'https://github.com/cube-js/arrow-datafusion.git', rev = "824a1a3276939c27f20db55163259adb9c586bac", default-features = false, features = ["regex_expressions", "unicode_expressions"] }
13+
datafusion = { git = 'https://github.com/cube-js/arrow-datafusion.git', rev = "aab20105f2a4c811add387076ba903cfeedd47dc", default-features = false, features = ["regex_expressions", "unicode_expressions"] }
1414
anyhow = "1.0"
1515
thiserror = "1.0.50"
1616
cubeclient = { path = "../cubeclient" }
1717
pg-srv = { path = "../pg-srv" }
18-
sqlparser = { git = 'https://github.com/cube-js/sqlparser-rs.git', rev = "dca8d9081fd8ad7c01302c112d204edc74e67170" }
18+
sqlparser = { git = 'https://github.com/cube-js/sqlparser-rs.git', rev = "b7f265a4590049f8274cef8411f63eddb5b4bf87" }
1919
lazy_static = "1.4.0"
2020
base64 = "0.13.0"
2121
tokio = { version = "^1.35", features = ["full", "rt", "tracing"] }

rust/cubesql/cubesql/src/compile/mod.rs

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21492,4 +21492,50 @@ LIMIT {{ limit }}{% endif %}"#.to_string(),
2149221492

2149321493
Ok(())
2149421494
}
21495+
21496+
#[tokio::test]
21497+
async fn test_string_unicode_escapes() {
21498+
init_logger();
21499+
21500+
let logical_plan = convert_select_to_query_plan(
21501+
r#"
21502+
SELECT rows.order_date, rows.customer_gender, sum(rows.sumPrice)
21503+
FROM (
21504+
select order_date, customer_gender, sumPrice
21505+
from KibanaSampleDataEcommerce
21506+
where notes = U&'HHHH-444JJJ\\Admin'
21507+
21508+
) rows
21509+
GROUP BY 1,2
21510+
"#
21511+
.to_string(),
21512+
DatabaseProtocol::PostgreSQL,
21513+
)
21514+
.await
21515+
.as_logical_plan();
21516+
21517+
assert_eq!(
21518+
logical_plan.find_cube_scan().request,
21519+
V1LoadRequestQuery {
21520+
measures: Some(vec!["KibanaSampleDataEcommerce.sumPrice".to_string(),]),
21521+
dimensions: Some(vec![
21522+
"KibanaSampleDataEcommerce.order_date".to_string(),
21523+
"KibanaSampleDataEcommerce.customer_gender".to_string(),
21524+
]),
21525+
segments: Some(vec![]),
21526+
time_dimensions: None,
21527+
order: None,
21528+
limit: None,
21529+
offset: None,
21530+
filters: Some(vec![V1LoadRequestQueryFilterItem {
21531+
member: Some("KibanaSampleDataEcommerce.notes".to_string()),
21532+
operator: Some("equals".to_string()),
21533+
values: Some(vec!["HHHH-444JJJ\\Admin".to_string()]),
21534+
or: None,
21535+
and: None
21536+
}]),
21537+
ungrouped: None,
21538+
}
21539+
)
21540+
}
2149521541
}

0 commit comments

Comments
 (0)