From 73a9ef52106a81bd6e748a4f1fb1ca475f2bfa7c Mon Sep 17 00:00:00 2001 From: Alexandr Romanenko Date: Tue, 31 Oct 2023 10:55:34 +0300 Subject: [PATCH] fix(cubestore): Error with pre-aggregation and filters containing comma. --- rust/cubestore/Cargo.lock | 6 +++--- .../cubestore-sql-tests/src/tests.rs | 19 ++++++++++++++++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/rust/cubestore/Cargo.lock b/rust/cubestore/Cargo.lock index 2e7612b9bb881..a121eeb772d95 100644 --- a/rust/cubestore/Cargo.lock +++ b/rust/cubestore/Cargo.lock @@ -131,7 +131,7 @@ checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "arrow" version = "5.0.0" -source = "git+https://github.com/cube-js/arrow-rs?branch=cube#12474778e8a77f7c53b6dac404b469489d38f642" +source = "git+https://github.com/cube-js/arrow-rs?branch=cube#2f71eda5d1167242b0100fd982f2067e2046abc0" dependencies = [ "bitflags", "chrono", @@ -154,7 +154,7 @@ dependencies = [ [[package]] name = "arrow-flight" version = "5.0.0" -source = "git+https://github.com/cube-js/arrow-rs?branch=cube#12474778e8a77f7c53b6dac404b469489d38f642" +source = "git+https://github.com/cube-js/arrow-rs?branch=cube#2f71eda5d1167242b0100fd982f2067e2046abc0" dependencies = [ "arrow", "base64 0.13.0", @@ -3335,7 +3335,7 @@ dependencies = [ [[package]] name = "parquet" version = "5.0.0" -source = "git+https://github.com/cube-js/arrow-rs?branch=cube#12474778e8a77f7c53b6dac404b469489d38f642" +source = "git+https://github.com/cube-js/arrow-rs?branch=cube#2f71eda5d1167242b0100fd982f2067e2046abc0" dependencies = [ "arrow", "base64 0.13.0", diff --git a/rust/cubestore/cubestore-sql-tests/src/tests.rs b/rust/cubestore/cubestore-sql-tests/src/tests.rs index 7a4226ab7a890..7a0b2b4e26bf0 100644 --- a/rust/cubestore/cubestore-sql-tests/src/tests.rs +++ b/rust/cubestore/cubestore-sql-tests/src/tests.rs @@ -1583,7 +1583,8 @@ async fn ilike(service: Box) { ('test [ special 1', '%test [%'),\ ('test ( special 2', '%test (%'),\ ('111 test {)?*|+aaa', '%test {)?*|+aaa'),\ - ('test2 }]\\\\222 ', 'test2 }]\\\\\\\\%')\ + ('test2 }]\\\\222 ', 'test2 }]\\\\\\\\%'),\ + ('test2 -[]{}()*+?.,^$|# 2', '%-[]{}()*+?.,^$|#%')\ ", ) @@ -1625,13 +1626,24 @@ async fn ilike(service: Box) { .exec_query("SELECT t FROM s.strings WHERE t ILIKE CONCAT('%', '(', '%') ORDER BY t") .await .unwrap(); - assert_eq!(to_rows(&r), rows(&["test ( special 2"])); + assert_eq!( + to_rows(&r), + rows(&["test ( special 2", "test2 -[]{}()*+?.,^$|# 2"]) + ); let r = service .exec_query("SELECT t FROM s.strings WHERE t ILIKE CONCAT('%', '?*|+', '%') ORDER BY t") .await .unwrap(); assert_eq!(to_rows(&r), rows(&["111 test {)?*|+aaa"])); + + let r = service + .exec_query( + "SELECT t FROM s.strings WHERE t ILIKE CONCAT('%', '-[]{}()*+?.,^', '%') ORDER BY t", + ) + .await + .unwrap(); + assert_eq!(to_rows(&r), rows(&["test2 -[]{}()*+?.,^$|# 2"])); // Compare constant string with a bunch of patterns. // Inputs are: ('aba', '%ABA'), ('ABa', '%aba%'), ('CABA', 'aba%'), ('ZABA', '%a%b%a%'), // ('ZZZ', 'zzz'), ('TTT', 'TTT'). @@ -1664,7 +1676,8 @@ async fn ilike(service: Box) { ("some_underscore", "%some\\_underscore%"), ("test ( special 2", "%test (%"), ("test [ special 1", "%test [%"), - ("test2 }]\\222 ", "test2 }]\\\\%") + ("test2 -[]{}()*+?.,^$|# 2", "%-[]{}()*+?.,^$|#%"), + ("test2 }]\\222 ", "test2 }]\\\\%"), ]) );