atlas-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Girish Ramachandran (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (ATLAS-263) Searching for a multi word trait always returns empty result
Date Wed, 25 Nov 2015 19:21:11 GMT

    [ https://issues.apache.org/jira/browse/ATLAS-263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15027328#comment-15027328
] 

Girish Ramachandran edited comment on ATLAS-263 at 11/25/15 7:21 PM:
---------------------------------------------------------------------

The discovery query should be enclosed with '`' character and not quote. But, if I try the
types query giving the multi-word trait name, I get an error message. Attached is a patch
for that. Please review.

Queries tried:
Create the trait:
curl 'http://localhost:21000/api/atlas/types' -H 'Origin: http://localhost:21000'  -H 'Content-Type:
application/json;charset=UTF-8' --data-binary '{"enumTypes":[],"traitTypes":[{"superTypes":[],"typeName":"multiple
words trait","attributeDefinitions":[],"hierarchicalMetaTypeName":"org.apache.atlas.typesystem.types.TraitType"}],"structTypes":[],"classTypes":[]}'
--compressed
{"requestId":"qtp120960120-15 - 0acee5cf-f9b0-420a-bbbc-aeaa95bb3932","types":[{"name":"multiple
words trait"}]}


Attach trait with an entity:
curl -v -X POST 'http://localhost:21000/api/atlas/entities/5989269b-3d45-4e89-9533-590138043d28/traits'
-H 'Content-Type: application/json;charset=UTF-8' --data-binary '{"jsonClass":"org.apache.atlas.typesystem.json.InstanceSerialization$_Struct","typeName":"multiple
words trait","values":{}}' --compressed


Query for the type (this errors out without the fix)
curl 'http://localhost:21000/api/atlas/types/multiple+words+trait'
{"typeName":"multiple words trait","definition":{"enumTypes":[],"structTypes":[],"traitTypes":[{"superTypes":[],"hierarchicalMetaTypeName":"org.apache.atlas.typesystem.types.TraitType","typeName":"multiple
words trait","attributeDefinitions":[]}],"classTypes":[]},"requestId":"qtp120960120-16 - 46ea02ca-18ad-4f22-a388-5a4e09dfb807"}


Query for the trait (note the enclosing ` char)
curl 'http://localhost:21000/api/atlas/discovery/search?query=`multiple+words+trait`'

{"requestId":"qtp120960120-14 - 93b8cf1b-fa79-4183-b895-c9c2219b4370","query":"`multiple words
trait`","queryType":"dsl","count":1,"results":[{"$typeName$":"__tempQueryResultStruct9","instanceInfo":{"$typeName$":"__IdType","guid":"5989269b-3d45-4e89-9533-590138043d28","typeName":"LoadProcess"},"traitDetails":null}],"dataType":{"typeName":"__tempQueryResultStruct9","attributeDefinitions":[{"name":"traitDetails","dataTypeName":"multiple
words trait","multiplicity":{"lower":0,"upper":1,"isUnique":false},"isComposite":false,"isUnique":false,"isIndexable":true,"reverseAttributeName":null},{"name":"instanceInfo","dataTypeName":"__IdType","multiplicity":{"lower":0,"upper":1,"isUnique":false},"isComposite":false,"isUnique":false,"isIndexable":true,"reverseAttributeName":null}]}}


was (Author: girishrp):
The discovery query should be enclosed with '`' character and not quote. But, if I try the
types query giving the multi-word trait name, I get an error message. Attached is a patch
for that. Please review.

Queries tried:
Create the trait:
curl 'http://localhost:21000/api/atlas/types' -H 'Origin: http://localhost:21000'  -H 'Content-Type:
application/json;charset=UTF-8' --data-binary '{"enumTypes":[],"traitTypes":[{"superTypes":[],"typeName":"multiple
words trait","attributeDefinitions":[],"hierarchicalMetaTypeName":"org.apache.atlas.typesystem.types.TraitType"}],"structTypes":[],"classTypes":[]}'
--compressed
{"requestId":"qtp120960120-15 - 0acee5cf-f9b0-420a-bbbc-aeaa95bb3932","types":[{"name":"multiple
words trait"}]}

Attach trait with an entity:
curl -v 'http://localhost:21000/api/atlas/entity/803f5bdd-28f9-49e1-8c21-3dc0f9fd5c61/traits'
-H 'Content-Type: application/json;charset=UTF-8' --data-binary '{"jsonClass":"org.apache.atlas.typesystem.json.InstanceSerialization$_Struct","typeName":"multiple
words trait","values":{}}' --compressed

Query for the type (this errors out without the fix)
curl 'http://localhost:21000/api/atlas/types/multiple+words+trait'
{"typeName":"multiple words trait","definition":{"enumTypes":[],"structTypes":[],"traitTypes":[{"superTypes":[],"hierarchicalMetaTypeName":"org.apache.atlas.typesystem.types.TraitType","typeName":"multiple
words trait","attributeDefinitions":[]}],"classTypes":[]},"requestId":"qtp120960120-16 - 46ea02ca-18ad-4f22-a388-5a4e09dfb807"}

Query for the trait (note the enclosing ` char)
curl 'http://localhost:21000/api/atlas/discovery/search?query=`multiple+words+trait`'
{"requestId":"qtp120960120-14 - 300c4fd6-00dc-42ad-9d1b-c65546d343bb","query":"`multiple words
trait`","queryType":"dsl","count":0,"results":[],"dataType":{"typeName":"__tempQueryResultStruct1","attributeDefinitions":[{"name":"traitDetails","dataTypeName":"multiple
words trait","multiplicity":{"lower":0,"upper":1,"isUnique":false},"isComposite":false,"isUnique":false,"isIndexable":true,"reverseAttributeName":null},{"name":"instanceInfo","dataTypeName":"__IdType","multiplicity":{"lower":0,"upper":1,"isUnique":false},"isComposite":false,"isUnique":false,"isIndexable":true,"reverseAttributeName":null}]}}

> Searching for a multi word trait always returns empty result
> ------------------------------------------------------------
>
>                 Key: ATLAS-263
>                 URL: https://issues.apache.org/jira/browse/ATLAS-263
>             Project: Atlas
>          Issue Type: Bug
>    Affects Versions: 0.6-incubating
>            Reporter: Ayub Khan
>            Priority: Blocker
>         Attachments: types_query_fix.patch
>
>
> Searching for a multi word trait always returns empty result..
> 1. Create a trait name with multiple words..
> 	Example: 
> {noformat}
> curl 'http://localhost:21000/api/atlas/types' -H 'Origin: http://localhost:21000'  -H
'Content-Type: application/json;charset=UTF-8' --data-binary '{"enumTypes":[],"traitTypes":[{"superTypes":[],"typeName":"multi
word trait","attributeDefinitions":[],"hierarchicalMetaTypeName":"org.apache.atlas.typesystem.types.TraitType"}],"structTypes":[],"classTypes":[]}'
--compressed
> {noformat}
> 2. Attach the tag with an entity
> 	Example:
> {noformat}
> curl -v 'http://localhost:21000/api/atlas/entity/803f5bdd-28f9-49e1-8c21-3dc0f9fd5c61/traits'
-H 'Content-Type: application/json;charset=UTF-8' --data-binary '{"jsonClass":"org.apache.atlas.typesystem.json.InstanceSerialization$_Struct","typeName":"multi
word trait","values":{}}' --compressed
> {noformat}
> 3. Now try to get all the entities associated with the tag
> 	Example:
> {noformat}
> curl 'http://localhost:21000/api/atlas/discovery/search?query=multi+word+trait'
> {noformat}
> 	
> 	Result of the above is always empty because the above query is triggered as "full text"
and it always returns empty result even if you have associated entites to the tag.
> 	
> This is a big issue from an end user's perspective. marking this as a blocker



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message