This is an automated email from the ASF dual-hosted git repository.
rongr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git
The following commit(s) were added to refs/heads/master by this push:
new 85d3850227 fix regex gen with escape issue on single quote (#12181)
85d3850227 is described below
commit 85d3850227cb648cac30e5b3d12f1e09c3920551
Author: Rong Rong <[email protected]>
AuthorDate: Wed Dec 20 09:06:31 2023 -0800
fix regex gen with escape issue on single quote (#12181)
Co-authored-by: Rong Rong <[email protected]>
---
.../test/java/org/apache/pinot/integration/tests/QueryGenerator.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/pinot-integration-test-base/src/test/java/org/apache/pinot/integration/tests/QueryGenerator.java
b/pinot-integration-test-base/src/test/java/org/apache/pinot/integration/tests/QueryGenerator.java
index be13943d59..8e3d3a84d9 100644
---
a/pinot-integration-test-base/src/test/java/org/apache/pinot/integration/tests/QueryGenerator.java
+++
b/pinot-integration-test-base/src/test/java/org/apache/pinot/integration/tests/QueryGenerator.java
@@ -1019,7 +1019,8 @@ public class QueryGenerator {
List<String> columnValues = _columnToValueList.get(columnName);
String value = pickRandom(columnValues);
// do regex only for string type
- if (value.startsWith("'") && value.endsWith("'")) {
+ // do not replace when there's single quote in between b/c it will cause
escape issues.
+ if (value.startsWith("'") && value.endsWith("'") && !value.substring(1,
value.length() - 1).contains("'")) {
// replace only one character for now with .* ignore the first and
last character
int indexToReplaceWithRegex = 1 + _random.nextInt(value.length() - 2);
String regex = value.substring(1, indexToReplaceWithRegex) + ".*" +
value.substring(indexToReplaceWithRegex + 1,
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]