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
c2d52759
Commit
c2d52759
authored
Jun 18, 2017
by
Madhan Neethiraj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1866: DSL 'like' operator fails for associated entity attributes
parent
906f3651
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
Gremlin2ExpressionFactory.java
...a/org/apache/atlas/gremlin/Gremlin2ExpressionFactory.java
+1
-3
Gremlin3ExpressionFactory.java
...a/org/apache/atlas/gremlin/Gremlin3ExpressionFactory.java
+1
-2
GraphBackedDiscoveryServiceTest.java
...ache/atlas/discovery/GraphBackedDiscoveryServiceTest.java
+3
-0
No files found.
repository/src/main/java/org/apache/atlas/gremlin/Gremlin2ExpressionFactory.java
View file @
c2d52759
...
@@ -40,7 +40,6 @@ import org.apache.atlas.groovy.LogicalExpression.LogicalOperator;
...
@@ -40,7 +40,6 @@ import org.apache.atlas.groovy.LogicalExpression.LogicalOperator;
import
org.apache.atlas.groovy.RangeExpression
;
import
org.apache.atlas.groovy.RangeExpression
;
import
org.apache.atlas.groovy.TernaryOperatorExpression
;
import
org.apache.atlas.groovy.TernaryOperatorExpression
;
import
org.apache.atlas.groovy.TraversalStepType
;
import
org.apache.atlas.groovy.TraversalStepType
;
import
org.apache.atlas.query.Expressions
;
import
org.apache.atlas.query.GraphPersistenceStrategies
;
import
org.apache.atlas.query.GraphPersistenceStrategies
;
import
org.apache.atlas.query.TypeUtils.FieldInfo
;
import
org.apache.atlas.query.TypeUtils.FieldInfo
;
import
org.apache.atlas.typesystem.types.IDataType
;
import
org.apache.atlas.typesystem.types.IDataType
;
...
@@ -154,9 +153,8 @@ public class Gremlin2ExpressionFactory extends GremlinExpressionFactory {
...
@@ -154,9 +153,8 @@ public class Gremlin2ExpressionFactory extends GremlinExpressionFactory {
GroovyExpression
nameExpr
=
new
FieldExpression
(
itExpr
,
propertyName
);
GroovyExpression
nameExpr
=
new
FieldExpression
(
itExpr
,
propertyName
);
GroovyExpression
matchesExpr
=
new
FunctionCallExpression
(
nameExpr
,
MATCHES
,
escapePropertyValue
(
propertyValue
));
GroovyExpression
matchesExpr
=
new
FunctionCallExpression
(
nameExpr
,
MATCHES
,
escapePropertyValue
(
propertyValue
));
GroovyExpression
closureExpr
=
new
ClosureExpression
(
matchesExpr
);
GroovyExpression
closureExpr
=
new
ClosureExpression
(
matchesExpr
);
GroovyExpression
filterExpr
=
new
FunctionCallExpression
(
parent
,
FILTER_METHOD
,
closureExpr
);
return
filterExpr
;
return
new
FunctionCallExpression
(
TraversalStepType
.
FILTER
,
parent
,
FILTER_METHOD
,
closureExpr
)
;
}
}
private
GroovyExpression
escapePropertyValue
(
GroovyExpression
propertyValue
)
{
private
GroovyExpression
escapePropertyValue
(
GroovyExpression
propertyValue
)
{
...
...
repository/src/main/java/org/apache/atlas/gremlin/Gremlin3ExpressionFactory.java
View file @
c2d52759
...
@@ -250,9 +250,8 @@ public class Gremlin3ExpressionFactory extends GremlinExpressionFactory {
...
@@ -250,9 +250,8 @@ public class Gremlin3ExpressionFactory extends GremlinExpressionFactory {
GroovyExpression
nameExpr
=
new
FieldExpression
(
itExpr
,
propertyName
);
GroovyExpression
nameExpr
=
new
FieldExpression
(
itExpr
,
propertyName
);
GroovyExpression
matchesExpr
=
new
FunctionCallExpression
(
nameExpr
,
MATCHES
,
escapePropertyValue
(
propertyValue
));
GroovyExpression
matchesExpr
=
new
FunctionCallExpression
(
nameExpr
,
MATCHES
,
escapePropertyValue
(
propertyValue
));
GroovyExpression
closureExpr
=
new
ClosureExpression
(
matchesExpr
);
GroovyExpression
closureExpr
=
new
ClosureExpression
(
matchesExpr
);
GroovyExpression
filterExpr
=
new
FunctionCallExpression
(
parent
,
FILTER_METHOD
,
closureExpr
);
return
filterExpr
;
return
new
FunctionCallExpression
(
TraversalStepType
.
FILTER
,
parent
,
FILTER_METHOD
,
closureExpr
)
;
}
}
private
GroovyExpression
escapePropertyValue
(
GroovyExpression
propertyValue
)
{
private
GroovyExpression
escapePropertyValue
(
GroovyExpression
propertyValue
)
{
...
...
repository/src/test/java/org/apache/atlas/discovery/GraphBackedDiscoveryServiceTest.java
View file @
c2d52759
...
@@ -290,6 +290,9 @@ public class GraphBackedDiscoveryServiceTest extends BaseRepositoryTest {
...
@@ -290,6 +290,9 @@ public class GraphBackedDiscoveryServiceTest extends BaseRepositoryTest {
{
"hive_db where hive_db.name like \"R???rt?*\" or hive_db.name like \"S?l?s\" or hive_db.name like\"Log*\""
,
3
},
{
"hive_db where hive_db.name like \"R???rt?*\" or hive_db.name like \"S?l?s\" or hive_db.name like\"Log*\""
,
3
},
{
"hive_db where hive_db.name like \"R???rt?*\" and hive_db.name like \"S?l?s\" and hive_db.name like\"Log*\""
,
0
},
{
"hive_db where hive_db.name like \"R???rt?*\" and hive_db.name like \"S?l?s\" and hive_db.name like\"Log*\""
,
0
},
{
"hive_table where name like 'sales*', db where name like 'Sa?es'"
,
1
},
{
"hive_table where name like 'sales*', db where name like 'Sa?es'"
,
1
},
{
"hive_table where name like 'sales*' and db.name like 'Sa?es'"
,
1
},
{
"hive_table where db.name like \"Sa*\""
,
4
},
{
"hive_table where db.name like \"Sa*\" and name like \"*dim\""
,
3
},
};
};
}
}
...
...
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