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
b5fe0896
Commit
b5fe0896
authored
Jan 09, 2020
by
Le Ma
Committed by
Madhan Neethiraj
Jan 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3580: incorrect results for search on __customAttributes
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
72389767
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
1 deletion
+31
-1
SearchProcessor.java
...main/java/org/apache/atlas/discovery/SearchProcessor.java
+1
-1
TestEntitiesREST.java
.../java/org/apache/atlas/web/adapters/TestEntitiesREST.java
+30
-0
No files found.
repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java
View file @
b5fe0896
...
...
@@ -404,7 +404,7 @@ public abstract class SearchProcessor {
}
ret
=
false
;
}
else
if
(
hasIndexQuerySpecialChar
(
filterCriteria
.
getAttributeValue
()))
{
}
else
if
(
hasIndexQuerySpecialChar
(
filterCriteria
.
getAttributeValue
())
&&
!
isPipeSeparatedSystemAttribute
(
filterCriteria
.
getAttributeName
())
)
{
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"special characters found in filter value {}, deferring to in-memory or graph query (might cause poor performance)"
,
filterCriteria
.
getAttributeValue
());
}
...
...
webapp/src/test/java/org/apache/atlas/web/adapters/TestEntitiesREST.java
View file @
b5fe0896
...
...
@@ -26,6 +26,7 @@ import static org.apache.atlas.TestUtilsV2.PII;
import
static
org
.
apache
.
atlas
.
TestUtilsV2
.
TABLE_TYPE
;
import
static
org
.
apache
.
atlas
.
model
.
discovery
.
SearchParameters
.
FilterCriteria
.
Condition
.
AND
;
import
static
org
.
apache
.
atlas
.
repository
.
Constants
.
CLASSIFICATION_NAMES_KEY
;
import
static
org
.
apache
.
atlas
.
repository
.
Constants
.
CUSTOM_ATTRIBUTES_PROPERTY_KEY
;
import
static
org
.
apache
.
atlas
.
repository
.
Constants
.
MODIFICATION_TIMESTAMP_PROPERTY_KEY
;
import
static
org
.
apache
.
atlas
.
repository
.
Constants
.
STATE_PROPERTY_KEY
;
import
static
org
.
apache
.
atlas
.
repository
.
Constants
.
TIMESTAMP_PROPERTY_KEY
;
...
...
@@ -154,6 +155,35 @@ public class TestEntitiesREST {
}
@Test
public
void
testCustomAttributesSearch
()
throws
Exception
{
AtlasEntity
dbWithCustomAttr
=
new
AtlasEntity
(
dbEntity
);
HashMap
customAttr
=
new
HashMap
<
String
,
String
>()
{{
put
(
"key1"
,
"value1"
);
}};
dbWithCustomAttr
.
setCustomAttributes
(
customAttr
);
AtlasEntitiesWithExtInfo
atlasEntitiesWithExtInfo
=
new
AtlasEntitiesWithExtInfo
(
dbWithCustomAttr
);
EntityMutationResponse
response
=
entityREST
.
createOrUpdate
(
atlasEntitiesWithExtInfo
);
Assert
.
assertNotNull
(
response
.
getUpdatedEntitiesByTypeName
(
DATABASE_TYPE
));
searchParameters
=
new
SearchParameters
();
searchParameters
.
setTypeName
(
"_ALL_ENTITY_TYPES"
);
SearchParameters
.
FilterCriteria
fc
=
new
SearchParameters
.
FilterCriteria
();
fc
.
setAttributeName
(
CUSTOM_ATTRIBUTES_PROPERTY_KEY
);
fc
.
setOperator
(
SearchParameters
.
Operator
.
EQ
);
fc
.
setAttributeValue
(
"\"key1:value1\""
);
searchParameters
.
setEntityFilters
(
fc
);
AtlasSearchResult
res
=
discoveryREST
.
searchWithParameters
(
searchParameters
);
Assert
.
assertNotNull
(
res
.
getEntities
());
Assert
.
assertEquals
(
res
.
getEntities
().
size
(),
1
);
}
@Test
public
void
testBasicSearch
()
throws
Exception
{
// search entities with classification named classification
searchParameters
=
new
SearchParameters
();
...
...
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