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
c0f0abc1
Commit
c0f0abc1
authored
7 years ago
by
apoorvnaik
Committed by
Madhan Neethiraj
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2121: basic-search update to use case-sensitive filter for type-name / tag-name
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
400477c4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
9 deletions
+18
-9
ClassificationSearchProcessor.java
...apache/atlas/discovery/ClassificationSearchProcessor.java
+9
-1
EntitySearchProcessor.java
...ava/org/apache/atlas/discovery/EntitySearchProcessor.java
+9
-8
No files found.
repository/src/main/java/org/apache/atlas/discovery/ClassificationSearchProcessor.java
View file @
c0f0abc1
...
...
@@ -34,6 +34,7 @@ import org.apache.atlas.util.SearchPredicateUtil;
import
org.apache.atlas.utils.AtlasPerfTracer
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.Predicate
;
import
org.apache.commons.collections.PredicateUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -93,7 +94,14 @@ public class ClassificationSearchProcessor extends SearchProcessor {
this
.
indexQuery
=
graph
.
indexQuery
(
Constants
.
VERTEX_INDEX
,
indexQueryString
);
inMemoryPredicate
=
constructInMemoryPredicate
(
classificationType
,
filterCriteria
,
indexAttributes
);
Predicate
typeNamePredicate
=
SearchPredicateUtil
.
getINPredicateGenerator
()
.
generatePredicate
(
Constants
.
TYPE_NAME_PROPERTY_KEY
,
typeAndSubTypes
,
String
.
class
);
Predicate
attributePredicate
=
constructInMemoryPredicate
(
classificationType
,
filterCriteria
,
indexAttributes
);
if
(
attributePredicate
!=
null
)
{
inMemoryPredicate
=
PredicateUtils
.
andPredicate
(
typeNamePredicate
,
attributePredicate
);
}
else
{
inMemoryPredicate
=
typeNamePredicate
;
}
}
else
{
indexQuery
=
null
;
}
...
...
This diff is collapsed.
Click to expand it.
repository/src/main/java/org/apache/atlas/discovery/EntitySearchProcessor.java
View file @
c0f0abc1
...
...
@@ -80,12 +80,20 @@ public class EntitySearchProcessor extends SearchProcessor {
if
(
typeSearchByIndex
)
{
constructTypeTestQuery
(
indexQuery
,
typeAndSubTypesQryStr
);
// TypeName check to be done in-memory as well to address ATLAS-2121 (case sensitivity)
inMemoryPredicate
=
typeNamePredicate
;
}
if
(
attrSearchByIndex
)
{
constructFilterQuery
(
indexQuery
,
entityType
,
filterCriteria
,
indexAttributes
);
inMemoryPredicate
=
constructInMemoryPredicate
(
entityType
,
filterCriteria
,
indexAttributes
);
Predicate
attributePredicate
=
constructInMemoryPredicate
(
entityType
,
filterCriteria
,
indexAttributes
);
if
(
inMemoryPredicate
!=
null
)
{
inMemoryPredicate
=
PredicateUtils
.
andPredicate
(
inMemoryPredicate
,
attributePredicate
);
}
else
{
inMemoryPredicate
=
attributePredicate
;
}
}
else
{
graphAttributes
.
addAll
(
indexAttributes
);
}
...
...
@@ -110,13 +118,6 @@ public class EntitySearchProcessor extends SearchProcessor {
if
(!
typeSearchByIndex
)
{
query
.
in
(
Constants
.
TYPE_NAME_PROPERTY_KEY
,
typeAndSubTypes
);
// Construct a parallel in-memory predicate
if
(
graphQueryPredicate
!=
null
)
{
graphQueryPredicate
=
PredicateUtils
.
andPredicate
(
graphQueryPredicate
,
typeNamePredicate
);
}
else
{
graphQueryPredicate
=
typeNamePredicate
;
}
}
// If we need to filter on the trait names then we need to build the query and equivalent in-memory predicate
...
...
This diff is collapsed.
Click to expand it.
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