This is an automated email from the ASF dual-hosted git repository.
pinal pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/master by this push:
new 01082f1 ATLAS-4341 : Regression: DSL query with like operator and
regex expression does not work
01082f1 is described below
commit 01082f1ea84d8c98cf4b7efc5bc88e0c71404e3f
Author: Pinal <pinal-shah>
AuthorDate: Tue Jun 22 22:33:42 2021 +0530
ATLAS-4341 : Regression: DSL query with like operator and regex expression
does not work
Signed-off-by: Pinal <pinal-shah>
---
repository/src/main/java/org/apache/atlas/query/IdentifierHelper.java | 2 +-
repository/src/test/java/org/apache/atlas/query/DSLQueriesTest.java | 1 +
.../src/test/java/org/apache/atlas/query/GremlinQueryComposerTest.java | 1 +
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git
a/repository/src/main/java/org/apache/atlas/query/IdentifierHelper.java
b/repository/src/main/java/org/apache/atlas/query/IdentifierHelper.java
index fa2217b..1a6b376 100644
--- a/repository/src/main/java/org/apache/atlas/query/IdentifierHelper.java
+++ b/repository/src/main/java/org/apache/atlas/query/IdentifierHelper.java
@@ -38,7 +38,7 @@ public class IdentifierHelper {
private static final Pattern SINGLE_QUOTED_IDENTIFIER =
Pattern.compile("'(\\w[\\w\\d\\.\\s]*)'");
private static final Pattern DOUBLE_QUOTED_IDENTIFIER =
Pattern.compile("\"(\\w[\\w\\d\\.\\s]*)\"");
private static final Pattern BACKTICK_QUOTED_IDENTIFIER =
Pattern.compile("`(\\w[\\w\\d\\.\\s]*)`");
- private static final Character[] ESCAPE_CHARS = new
Character[] {'+', '@', '#', '&', '|', '(', ')', '{', '}', '[', ']', '~', '\\',
'/'};
+ private static final Character[] ESCAPE_CHARS = new
Character[] {'@', '#', '&', '~', '/'};
private static final Set<Character> ESCAPE_CHARACTERS_SET = new
HashSet<>(Arrays.asList(ESCAPE_CHARS));
public static String get(String quotedIdentifier) {
diff --git
a/repository/src/test/java/org/apache/atlas/query/DSLQueriesTest.java
b/repository/src/test/java/org/apache/atlas/query/DSLQueriesTest.java
index 83d273f..74cc4e0 100644
--- a/repository/src/test/java/org/apache/atlas/query/DSLQueriesTest.java
+++ b/repository/src/test/java/org/apache/atlas/query/DSLQueriesTest.java
@@ -594,6 +594,7 @@ public class DSLQueriesTest extends BasicTestSetup {
//TEXT Mapping
{"hive_db where description like \"*/warehouse/*\"", 3, new
ListValidator("Sales","Reporting","Logging")},
{"hive_db where description like \"/apps/warehouse/*\"", 3,
new ListValidator("Sales","Reporting","Logging")},
+ {"hive_table where name like \"table[0-2]\"", 2, new
ListValidator("table1", "table2")},
};
}
diff --git
a/repository/src/test/java/org/apache/atlas/query/GremlinQueryComposerTest.java
b/repository/src/test/java/org/apache/atlas/query/GremlinQueryComposerTest.java
index 7885712..52cb68c 100644
---
a/repository/src/test/java/org/apache/atlas/query/GremlinQueryComposerTest.java
+++
b/repository/src/test/java/org/apache/atlas/query/GremlinQueryComposerTest.java
@@ -214,6 +214,7 @@ public class GremlinQueryComposerTest {
verify( "Table where owner like \"Jane/*\"", "g.V().has('__typeName',
'Table').has('Table.owner',
org.janusgraph.core.attribute.Text.textRegex(\"Jane\\/.*\")).dedup().limit(25).toList()");
verify( "Table where Asset.name like \"/sales_*\"",
"g.V().has('__typeName', 'Table').has('Asset.__s_name',
org.janusgraph.core.attribute.Text.textRegex(\"\\/sales_.*\")).dedup().limit(25).toList()");
verify( "Table where Asset.name like \"sales:*\"",
"g.V().has('__typeName', 'Table').has('Asset.__s_name',
org.janusgraph.core.attribute.Text.textRegex(\"sales:.*\")).dedup().limit(25).toList()");
+ verify( "Table where Asset.name like \"table[0-9]\"",
"g.V().has('__typeName', 'Table').has('Asset.__s_name',
org.janusgraph.core.attribute.Text.textRegex(\"table[0-9]\")).dedup().limit(25).toList()");
}
@Test