Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
5955fcd1
Commit
5955fcd1
authored
Dec 02, 2019
by
Nikhil Bonte
Committed by
Ashutosh Mestry
Dec 02, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3532: DSL Composer update to address '_' test case. Part #2
Signed-off-by:
Ashutosh Mestry
<
amestry@hortonworks.com
>
parent
48df6544
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
2 deletions
+5
-2
GremlinQueryComposer.java
...ain/java/org/apache/atlas/query/GremlinQueryComposer.java
+1
-1
IdentifierHelper.java
...rc/main/java/org/apache/atlas/query/IdentifierHelper.java
+3
-0
GremlinQueryComposerTest.java
...java/org/apache/atlas/query/GremlinQueryComposerTest.java
+1
-1
No files found.
repository/src/main/java/org/apache/atlas/query/GremlinQueryComposer.java
View file @
5955fcd1
...
...
@@ -220,7 +220,7 @@ public class GremlinQueryComposer {
}
private
boolean
containsNumberAndLettersOnly
(
String
rhs
)
{
return
Pattern
.
matches
(
REGEX_ALPHA_NUMERIC_PATTERN
,
rhs
);
return
Pattern
.
matches
(
REGEX_ALPHA_NUMERIC_PATTERN
,
IdentifierHelper
.
removeWildcards
(
rhs
)
);
}
private
String
parseNumber
(
String
rhs
,
Context
context
)
{
...
...
repository/src/main/java/org/apache/atlas/query/IdentifierHelper.java
View file @
5955fcd1
...
...
@@ -113,6 +113,9 @@ public class IdentifierHelper {
return
s
.
replace
(
"*"
,
".*"
).
replace
(
'?'
,
'.'
);
}
public
static
String
removeWildcards
(
String
s
)
{
return
removeQuotes
(
s
).
replace
(
"*"
,
""
).
replace
(
"?"
,
""
);
}
public
static
class
Info
{
private
String
raw
;
...
...
repository/src/test/java/org/apache/atlas/query/GremlinQueryComposerTest.java
View file @
5955fcd1
...
...
@@ -168,7 +168,7 @@ public class GremlinQueryComposerTest {
verify
(
"Table where Asset.name like \"Tab*\""
,
"g.V().has('__typeName', 'Table').has('Asset.__s_name', org.janusgraph.core.attribute.Text.textRegex(\"Tab.*\")).dedup().limit(25).toList()"
);
verify
(
"Table where owner like \"Tab*\""
,
"g.V().has('__typeName', 'Table').has('Table.owner', org.janusgraph.core.attribute.Text.textRegex(\"Tab.*\")).dedup().limit(25).toList()"
);
"g.V().has('__typeName', 'Table').has('Table.owner', org.janusgraph.core.attribute.Text.text
Contains
Regex(\"Tab.*\")).dedup().limit(25).toList()"
);
verify
(
"Table where owner like \"*Tab_*\""
,
"g.V().has('__typeName', 'Table').has('Table.owner', org.janusgraph.core.attribute.Text.textRegex(\".*Tab_.*\")).dedup().limit(25).toList()"
);
verify
(
"from Table where (db.name = \"Reporting\")"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment